@@ -10,6 +10,16 @@ let
13+ toStorePath = target:
14+ # If a store path has been given, transform it to a string. And make sure
15+ # to capture the store path in its context.
16+ if 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.
13 arx = { archive, startup}:
23 arx = { archive, startup}:
14 stdenv.mkDerivation {
24 stdenv.mkDerivation {
15 name = "arx";
25 name = "arx";
@@ -71,9 +81,13 @@ in rec {
73 makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run }:
83 makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run }:
85+ # Avoid re-adding a store path into the store
86+ path = toStorePath target;
74 writeScript "startup" ''
88 writeScript "startup" ''
76− .${nix-user-chroot'}/bin/nix-user-chroot -n ./nix ${nixUserChrootFlags} -- ${target}${run} "$@"
90+ .${nix-user-chroot'}/bin/nix-user-chroot -n ./nix ${nixUserChrootFlags} -- ${path}${run} "$@"
79 nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "" }:
93 nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "" }: