Skip to content

Commit f3da67c

Browse files
committed
Add NP_DIRNAME
1 parent 42803a3 commit f3da67c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ The following environment variables are optional and can be used to override the
176176
```txt
177177
NP_DEBUG (1 = debug msgs; 2 = 'set -x' for nix-portable)
178178
NP_GIT specify path to the git executable
179-
NP_LOCATION where to put the `.nix-portable` dir. (defaults to `$HOME`)
179+
NP_LOCATION where to put the data dir. (defaults to `$HOME`)
180+
NP_DIRNAME name of the data dir. (defaults to `.nix-portable`)
180181
NP_RUNTIME which runtime to use (must be one of: nix, bwrap, proot)
181182
NP_NIX specify the path to the static nix executable to use in case nix is selected as runtime
182183
NP_BWRAP specify the path to the bwrap executable to use in case bwrap is selected as runtime

default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ let
131131
132132
# user specified location for program files and nix store
133133
[ -z "\$NP_LOCATION" ] && NP_LOCATION="\$HOME"
134+
[ -z "\$NP_DIRNAME" ] && NP_DIRNAME=".nix-portable"
134135
NP_LOCATION="\$(readlink -f "\$NP_LOCATION")"
135-
dir="\$NP_LOCATION/.nix-portable"
136+
dir="\$NP_LOCATION/\$NP_DIRNAME"
136137
store="\$dir/nix/store"
137138
# create /nix/var/nix to prevent nix from falling back to chroot store.
138139
mkdir -p \$dir/{bin,nix/var/nix,nix/store}

0 commit comments

Comments
 (0)