diff options
Diffstat (limited to 'shell-scripts.nix')
| -rw-r--r-- | shell-scripts.nix | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/shell-scripts.nix b/shell-scripts.nix index 5cec1eb..32d77d0 100644 --- a/shell-scripts.nix +++ b/shell-scripts.nix @@ -1,11 +1,23 @@ -{pkgs, ...}: +{pkgs, config, ...}: with builtins; let script-names = attrNames (readDir ./shell-scripts); package = ( - filename: let - contents = readFile ./shell-scripts/${filename}; + filename: with pkgs; let in - pkgs.writeShellScriptBin filename contents + stdenv.mkDerivation { + name = filename; + + buildCommand = '' + install -Dm755 $script $out/bin/${filename} + ''; + + script = substituteAll { + src = ./shell-scripts/${filename}; + isExecutable = true; + inherit bash; + home = config.home.homeDirectory; + }; + } ); packages = map package script-names; in |
