-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
32 lines (31 loc) · 711 Bytes
/
package.nix
File metadata and controls
32 lines (31 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ lib
, bash
, coreutils
, gnused
, jq
, writeShellScriptBin
, ...
}:
let
substFullPaths = program_package:
let replaceList = lib.attrsets.mapAttrsToList (name: pkg: { from = " ${name} "; to = " ${pkg}/bin/${name} "; }) program_package; in
builtins.replaceStrings (map (x: x.from) replaceList) (map (x: x.to) replaceList);
in
(writeShellScriptBin "bash-env-json"
(substFullPaths
{
env = coreutils;
jq = jq;
mktemp = coreutils;
rm = coreutils;
sed = gnused;
touch = coreutils;
}
(builtins.readFile ./bash-env-json))).overrideAttrs (old: {
buildInputs = [ bash ];
buildCommand =
''
${old.buildCommand}
patchShebangs $out
'';
})