Remove sgid from .nix-portable

This should prevent issues when putting it under /gpfs/{projects,scratch} that have sgid.
This commit is contained in:
2026-03-05 16:55:21 +01:00
parent f2489dcc3d
commit b468ca50c6

View File

@@ -151,6 +151,11 @@ let
[ -z "\$NP_LOCATION" ] && NP_LOCATION="\$HOME"
NP_LOCATION="\$(readlink -f "\$NP_LOCATION")"
dir="\$NP_LOCATION/.nix-portable"
# Create NP_LOCATION and remove sgid bit
mkdir -p \$dir
chmod g-s \$dir
store="\$dir/nix/store"
# create /nix/var/nix to prevent nix from falling back to chroot store.
mkdir -p \$dir/{bin,nix/var/nix,nix/store}