From: Ismaƫl Bouya Date: Fri, 19 Apr 2019 14:25:54 +0000 (+0200) Subject: Add sandbox warning in setup script X-Git-Tag: nur_publish~131 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=08822d6f730053c97cfd9c27111b4302d9a94081 Add sandbox warning in setup script --- diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap index 2094924..3a894f9 100755 --- a/nixops/scripts/nixops_wrap +++ b/nixops/scripts/nixops_wrap @@ -29,5 +29,6 @@ done nixops set-args --argstr privateFiles "$TEMP" source $(dirname $(dirname $DIR))/nix_path_env +# __noChroot: ssh-config-file requires relaxed export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" nixops "$@" diff --git a/nixops/scripts/setup b/nixops/scripts/setup index 929b27a..38cee65 100755 --- a/nixops/scripts/setup +++ b/nixops/scripts/setup @@ -93,6 +93,19 @@ if [ ! -f /etc/ssh/ssh_rsa_key_nixops ]; then fi fi +if nix show-config --json | jq -e '.sandbox.value == "true"' >/dev/null; then + cat <<-EOF + There are some impure derivations in the repo currently (grep __noChroot), please put + sandbox = "relaxed" + in /etc/nix/nix.conf + you may also want to add + keep-outputs = true + keep-derivations = true + to prevent garbage collector from deleting build dependencies (they take a lot of time to build) + EOF + exit 1 +fi + if ! which nixops 2>/dev/null >/dev/null; then cat <<-EOF nixops is needed: