Skip to content

Commit d30d100

Browse files
committed
restore nix
1 parent 25b8206 commit d30d100

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ let
9696
git = git.out; # TODO why not just "git"
9797
inherit
9898
bwrapStaticBin
99+
nix
99100
nixStaticBin
100101
prootStaticBin
101102
zstdStaticBin

runtimeScript.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
zstdStaticBin=@zstdStaticBin@
55
prootStaticBin=@prootStaticBin@
66
bwrapStaticBin=@bwrapStaticBin@
7+
nix=@nix@
78
nixStaticBin=@nixStaticBin@
89
busyboxStaticBin=@busyboxStaticBin@
910
busyboxBins=(@busyboxBins@)
@@ -357,7 +358,7 @@ debug "NP_RUNTIME: $NP_RUNTIME"
357358
### setup runtime args
358359
if [ "$NP_RUNTIME" == "nix" ]; then
359360
run="$NP_NIX shell -f $dir/mini-drv.nix -c"
360-
PATH="$PATH:$store$(removePrefix "/nix/store" $nixStaticBin)/bin"
361+
PATH="$PATH:$store$(removePrefix "/nix/store" $nix)/bin"
361362
export PATH
362363
NP_CONF_STORE="$dir"
363364
recreate_nix_conf
@@ -426,7 +427,7 @@ index="$(cat $storeTar/closureInfo/store-paths)"
426427
if [ -n "$missing" ]; then
427428
debug "registering new store paths to DB"
428429
# reg="$(cat $storeTar/closureInfo/registration)"
429-
cmd="$run $store$(removePrefix "/nix/store" $nixStaticBin)/bin/nix-store --load-db"
430+
cmd="$run $store$(removePrefix "/nix/store" $nix)/bin/nix-store --load-db"
430431
debug "running command: $cmd"
431432
# echo "$reg" | $cmd
432433
fi
@@ -451,11 +452,11 @@ elif [[ "$(basename "$0")" == nix-portable* ]]; then\
451452
bin="$(which "$2")"
452453
shift; shift
453454
else
454-
bin="$store$(removePrefix "/nix/store" $nixStaticBin)/bin/$1"
455+
bin="$store$(removePrefix "/nix/store" $nix)/bin/$1"
455456
shift
456457
fi
457458
else
458-
bin="$store$(removePrefix "/nix/store" $nixStaticBin)/bin/$(basename "$0")"
459+
bin="$store$(removePrefix "/nix/store" $nix)/bin/$(basename "$0")"
459460
fi
460461

461462

@@ -472,7 +473,7 @@ fi
472473
### check if nix is functional with or without sandbox
473474
# sandbox-fallback is not reliable: https://github.com/NixOS/nix/issues/4719
474475
if [ "$newNPVersion" == "true" ] || [ "$lastRuntime" != "$NP_RUNTIME" ]; then
475-
nixBin="$store$(removePrefix "/nix/store" $nixStaticBin)/bin/nix"
476+
nixBin="$store$(removePrefix "/nix/store" $nix)/bin/nix"
476477
# if [ "$NP_RUNTIME" == "nix" ]; then
477478
# nixBin="nix"
478479
# else
@@ -518,7 +519,7 @@ export PATH="$dir/tmpbin:$PATH"
518519
### install git via nix, if git installation is not in /nix path
519520
if $doInstallGit && [ ! -e "$store$(removePrefix "/nix/store" $git)" ] ; then
520521
echo "Installing git. Disable this by specifying the git executable path with 'NP_GIT'"
521-
$run "$store$(removePrefix "/nix/store" $nixStaticBin)/bin/nix" build --impure --no-link --expr "
522+
$run "$store$(removePrefix "/nix/store" $nix)/bin/nix" build --impure --no-link --expr "
522523
(import $nixpkgsSrc {}).$gitAttribute.out
523524
"
524525
else

0 commit comments

Comments
 (0)