]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Source environemnt before building nixops in scripts
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 27 Apr 2019 12:36:33 +0000 (14:36 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 27 Apr 2019 12:36:33 +0000 (14:36 +0200)
nixops/scripts/nixops_wrap
nixops/scripts/pull_deployment
nixops/scripts/push_deployment
nixops/scripts/setup

index e4f5dc5e94c51f9df2f5f34c90ba5189a11e47f5..e50b24687913c4fe7b0b9ea2697ddd09fe3e9359 100755 (executable)
@@ -10,6 +10,10 @@ TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
 chmod go-rwx $TEMP
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+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="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
 
 finish() {
@@ -30,7 +34,4 @@ for file in $files; do
 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 "$@"
index d238434451176f0455846f1a082f51d60abcdbdf..2fc07bc4a1d8e0e6e8d340b2167d1671fd32082c 100755 (executable)
@@ -8,6 +8,7 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then
 fi
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+source $(dirname $(dirname $DIR))/nix_path_env
 nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
 export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
 
index 73084e40bdbf9f2c1082f39831bdd5059781ee3c..c8c34eeb8d020f218dc2c761841acdc7bb898c7f 100755 (executable)
@@ -8,6 +8,7 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then
 fi
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+source $(dirname $(dirname $DIR))/nix_path_env
 nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
 export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
 export NIXOPS_DEPLOYMENT="$DeploymentUuid"
index cfa8d64092365c3e513b86201fb9c3dac1ac920d..55dd9d99d883dc5935a15b7c8a0d6da86e032755 100755 (executable)
@@ -135,6 +135,7 @@ if nix show-config --json | jq -e '.sandbox.value == "true"' >/dev/null; then
 fi
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+source $(dirname $(dirname $DIR))/nix_path_env
 nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
 export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
 export NIXOPS_DEPLOYMENT="$DeploymentUuid"