From 40fde9eaad2c843f13cd10f33396d2e18b0e95fb Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 27 Oct 2018 13:15:27 +0200 Subject: implement writeBash with makeScriptWriter --- pkgs/default.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'pkgs/default.nix') diff --git a/pkgs/default.nix b/pkgs/default.nix index 084702d..5bce622 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -164,14 +164,9 @@ pkgs: oldpkgs: { echo hello world '' */ - writeBash = name: text: - assert (with types; either absolute-pathname filename).check name; - pkgs.write (baseNameOf name) { - ${optionalString (types.absolute-pathname.check name) name} = { - executable = true; - text = "#! ${pkgs.bash}/bin/bash\n${text}"; - }; - }; + writeBash = pkgs.makeScriptWriter { + interpreter = "${pkgs.bash}/bin/bash"; + }; writeBashBin = name: assert types.filename.check name; -- cgit v1.2.3