From 76babb209b22ab307c98912c6820ca4fdf221458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Thu, 5 Mar 2026 16:55:21 +0100 Subject: [PATCH] Remove sgid from .nix-portable and set group This should prevent issues when putting it under /gpfs/{projects,scratch} that have sgid and group=nobody. --- pkgs/nix-portable/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/nix-portable/default.nix b/pkgs/nix-portable/default.nix index 0bbc44ae..96838508 100644 --- a/pkgs/nix-portable/default.nix +++ b/pkgs/nix-portable/default.nix @@ -150,6 +150,12 @@ 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 + chgrp bsc \$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}