@@ -10,6 +10,16 @@ let
1010 '';
1111 });
1212in rec {
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.
21+ else "${target}";
22+
1323 arx = { archive, startup}:
1424 stdenv.mkDerivation {
1525 name = "arx";
@@ -71,9 +81,13 @@ in rec {
7181 };
7282
7383 makeStartup = { target, nixUserChrootFlags, nix-user-chroot', run }:
84+ let
85+ # Avoid re-adding a store path into the store
86+ path = toStorePath target;
87+ in
7488 writeScript "startup" ''
7589 #!/bin/sh
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} "$@"
7791 '';
7892
7993 nix-bootstrap = { target, extraTargets ? [], run, nix-user-chroot' ? nix-user-chroot, nixUserChrootFlags ? "" }: