From: Ismaƫl Bouya Date: Sun, 17 Mar 2019 09:10:19 +0000 (+0100) Subject: Revert "Revert personnal nix path" X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=cdd7f5e1ba8ac50d67834106c1af847690a9c719 Revert "Revert personnal nix path" This reverts commit 774d7a7f22bc36c4554750c9f575b6d7d3c776e3. --- diff --git a/nixops/modules/pub/restrict b/nixops/modules/pub/restrict index b2f3be3..6204aa2 100644 --- a/nixops/modules/pub/restrict +++ b/nixops/modules/pub/restrict @@ -2,6 +2,7 @@ user="$1" rootuser="$HOME/$user/" mkdir -p $rootuser +mkdir -p $HOME/$user-nixstore orig="$SSH_ORIGINAL_COMMAND" if [ -z "$orig" ]; then @@ -28,6 +29,7 @@ rsync*) set -euo pipefail (exec -c bwrap --ro-bind /usr /usr \ + --bind /var/lib/pub/$user-nixstore /nix \ --args 10 \ --dir /tmp \ --dir /var \ @@ -44,6 +46,7 @@ rsync*) --bind /var/lib/pub/$user /var/lib/pub \ --dir /var/lib/commons \ --ro-bind $TMUX_RESTRICT /var/lib/commons/tmux.restrict.conf \ + --file 9 /var/lib/commons/nix-dump \ --chdir /var/lib/pub \ --unshare-all \ --share-net \ @@ -57,6 +60,7 @@ rsync*) --file 11 /etc/passwd \ --file 12 /etc/group \ -- $orig) \ + 9< <(nix-store --dump-db) \ 10< <(nix_store_paths) \ 11< <(getent passwd $UID 65534) \ 12< <(getent group $(id -g) 65534)