Fix errors about NIX_STORE_DIR being unset.

This commit is contained in:
Ben Radford 2023-07-20 10:27:35 +01:00
parent 9769a0ae7d
commit 878c84d5ee
No known key found for this signature in database
GPG Key ID: 9DF5D4640AB888D5
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ nix-store --verify-path --store "$storeA" "$path"
# Verifying path in merged-store
nix-store --verify-path --store "$storeB" "$path"
hashPart=$(echo $path | sed "s^$NIX_STORE_DIR/^^" | sed 's/-.*//')
hashPart=$(echo $path | sed "s^${NIX_STORE_DIR:-/nix/store}/^^" | sed 's/-.*//')
# Lower store can find from hash part
[[ $(nix store --store $storeA path-from-hash-part $hashPart) == $path ]]

View File

@ -53,7 +53,7 @@ remountOverlayfs () {
toRealPath () {
storeDir=$1; shift
storePath=$1; shift
echo $storeDir$(echo $storePath | sed "s^$NIX_STORE_DIR^^")
echo $storeDir$(echo $storePath | sed "s^${NIX_STORE_DIR:-/nix/store}^^")
}
initLowerStore () {