dotfiles/bin/default.nix

22 lines
730 B
Nix
Raw Normal View History

2021-05-29 18:05:31 +02:00
{ pkgs ? import <nixpkgs> { } }:
2016-09-17 15:09:53 +02:00
#{ writeScript ? pkgs.writeScript, lib ? pkgs.lib, stdenv ? pkgs.stdenv }:
with pkgs;
let
2021-05-29 18:05:31 +02:00
compileShell = src: buildInputs: name:
stdenv.mkDerivation {
inherit name src;
buildInputs = buildInputs ++ [ makeWrapper ];
unpackPhase = "true";
installPhase = ''
mkdir -p $out/bin && cp $src $out/bin/${name}
wrapProgram $out/bin/${name} --suffix PATH : ${
lib.makeSearchPath "bin" buildInputs
}
'';
};
2016-09-17 15:09:53 +02:00
in lib.mapAttrs (k: f: f k) {
2021-05-29 18:05:31 +02:00
backup = compileShell ./backup.sh (with pkgs; [ utillinux duplicity ]);
screenshot_public =
compileShell ./screenshot_public.sh (with pkgs; [ scrot xclip rsync ]);
2016-09-17 15:09:53 +02:00
}