on 2e39b20 help sign in
1 file changed+8−10
since splitsnapshots
unifiedsplit
default.nix+8−10
default.nix+8−10
@@ -11,11 +11,10 @@ let
1111 });
1212in rec {
1313 toStorePath = target:
14− # If a store path has been given but is not a derivation, add the missing context
14+ # If a store path has been given but is a string, add the missing context
1515 # 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; }; }
16+ if builtins.isString target && lib.isStorePath target then
17+ builtins.appendContext target { "${target}" = { path = true; }; }
1918 # Otherwise, add to the store. This takes care of appending the store path
2019 # in the context automatically.
2120 else "${target}";
@@ -80,20 +79,19 @@ in rec {
8079 };
8180 };
8281
83− makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run, initScript }:
82+ makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run }:
8483 let
8584 # Avoid re-adding a store path into the store
8685 path = toStorePath target;
8786 in
8887 writeScript "startup" ''
8988 #!/bin/sh
90− ${initScript}
9189 .${nix-user-chroot'}/bin/nix-user-chroot -n ./nix ${nixUserChrootFlags} -- ${path}${run} "$@"
9290 '';
9391
94− nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "", initScript ? "" }:
92+ nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "" }:
9593 let
96− script = makeStartup { inherit target nixUserChrootFlags nix-user-chroot' run initScript; };
94+ script = makeStartup { inherit target nixUserChrootFlags nix-user-chroot' run; };
9795 in makebootstrap {
9896 startup = ".${script} '\"$@\"'";
9997 targets = [ "${script}" ] ++ extraTargets;
@@ -112,8 +110,8 @@ in rec {
112110 makeFlags = o.makeFlags ++ [
113111 ''ENV_PATH="${lib.makeBinPath targets}"''
114112 ];
115− }); in { target, extraTargets ? [], run, initScript ? "" }: nix-bootstrap {
116− inherit target extraTargets run initScript;
113+ }); in { target, extraTargets ? [], run }: nix-bootstrap {
114+ inherit target extraTargets run;
117115 nix-user-chroot' = nix-user-chroot'' extraTargets;
118116 };
119117}