@@ -10,16 +10,6 @@ let
1010 '';
1111 });
1212in rec {
13− toStorePath = target:
14− # If a store path has been given but is not a derivation, add the missing context
15− # to it so it will be propagated properly as a build input.
16− if !(lib.isDerivation target) && lib.isStorePath target then
17− let path = toString target; in
18− builtins.appendContext path { "${path}" = { path = true; }; }
19− # Otherwise, add to the store. This takes care of appending the store path
20− # in the context automatically.
21− else "${target}";
22−
2313 arx = { archive, startup}:
2414 stdenv.mkDerivation {
2515 name = "arx";
@@ -45,7 +35,7 @@ in rec {
4535 };
4636
4737 # TODO: eventually should this go in nixpkgs?
48− nix-user-chroot = lib.makeOverridable stdenv.mkDerivation {
38+ nix-user-chroot = stdenv.lib.makeOverridable stdenv.mkDerivation {
4939 name = "nix-user-chroot-2c52b5f";
5040 src = ./nix-user-chroot;
5141
@@ -80,20 +70,15 @@ in rec {
8070 };
8171 };
8272
83− makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run, initScript }:
84− let
85− # Avoid re-adding a store path into the store
86− path = toStorePath target;
87− in
73+ makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run }:
8874 writeScript "startup" ''
8975 #!/bin/sh
90− ${initScript}
91− .${nix-user-chroot'}/bin/nix-user-chroot -n ./nix ${nixUserChrootFlags} -- ${path}${run} "$@"
76+ .${nix-user-chroot'}/bin/nix-user-chroot -n ./nix ${nixUserChrootFlags} -- ${target}${run} $@
9277 '';
9378
94− nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "", initScript ? "" }:
79+ nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "" }:
9580 let
96− script = makeStartup { inherit target nixUserChrootFlags nix-user-chroot' run initScript; };
81+ script = makeStartup { inherit target nixUserChrootFlags nix-user-chroot' run; };
9782 in makebootstrap {
9883 startup = ".${script} '\"$@\"'";
9984 targets = [ "${script}" ] ++ extraTargets;
@@ -110,10 +95,10 @@ in rec {
11095 nix-user-chroot'' = targets: nix-user-chroot.overrideDerivation (o: {
11196 buildInputs = o.buildInputs ++ targets;
11297 makeFlags = o.makeFlags ++ [
113− ''ENV_PATH="${lib.makeBinPath targets}"''
98+ ''ENV_PATH="${stdenv.lib.makeBinPath targets}"''
11499 ];
115− }); in { target, extraTargets ? [], run, initScript ? "" }: nix-bootstrap {
116− inherit target extraTargets run initScript;
100+ }); in { target, extraTargets ? [], run }: nix-bootstrap {
101+ inherit target extraTargets run;
117102 nix-user-chroot' = nix-user-chroot'' extraTargets;
118103 };
119104}