aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-27 14:36:33 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-27 14:36:33 +0200
commit11234d0798eeb56b2a09bfc66925e782ace465e3 (patch)
treea0f00c1f7b9b9aaa168763339dc703e0fc5569dc
parent941bfb6ff039b6bfd94cc5aec8a0ef6dd1b82f36 (diff)
downloadNix-11234d0798eeb56b2a09bfc66925e782ace465e3.tar.gz
Nix-11234d0798eeb56b2a09bfc66925e782ace465e3.tar.zst
Nix-11234d0798eeb56b2a09bfc66925e782ace465e3.zip
Source environemnt before building nixops in scripts
-rwxr-xr-xnixops/scripts/nixops_wrap7
-rwxr-xr-xnixops/scripts/pull_deployment1
-rwxr-xr-xnixops/scripts/push_deployment1
-rwxr-xr-xnixops/scripts/setup1
4 files changed, 7 insertions, 3 deletions
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap
index e4f5dc5..e50b246 100755
--- a/nixops/scripts/nixops_wrap
+++ b/nixops/scripts/nixops_wrap
@@ -10,6 +10,10 @@ TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
10chmod go-rwx $TEMP 10chmod go-rwx $TEMP
11 11
12DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 12DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
13source $(dirname $(dirname $DIR))/nix_path_env
14# __noChroot: ssh-config-file requires relaxed
15export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH"
16
13nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" 17nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
14 18
15finish() { 19finish() {
@@ -30,7 +34,4 @@ for file in $files; do
30done 34done
31$nixops set-args --argstr privateFiles "$TEMP" 35$nixops set-args --argstr privateFiles "$TEMP"
32 36
33source $(dirname $(dirname $DIR))/nix_path_env
34# __noChroot: ssh-config-file requires relaxed
35export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH"
36$nixops "$@" 37$nixops "$@"
diff --git a/nixops/scripts/pull_deployment b/nixops/scripts/pull_deployment
index d238434..2fc07bc 100755
--- a/nixops/scripts/pull_deployment
+++ b/nixops/scripts/pull_deployment
@@ -8,6 +8,7 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then
8fi 8fi
9 9
10DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 10DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
11source $(dirname $(dirname $DIR))/nix_path_env
11nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" 12nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
12export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 13export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
13 14
diff --git a/nixops/scripts/push_deployment b/nixops/scripts/push_deployment
index 73084e4..c8c34ee 100755
--- a/nixops/scripts/push_deployment
+++ b/nixops/scripts/push_deployment
@@ -8,6 +8,7 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then
8fi 8fi
9 9
10DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 10DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
11source $(dirname $(dirname $DIR))/nix_path_env
11nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" 12nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
12export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 13export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
13export NIXOPS_DEPLOYMENT="$DeploymentUuid" 14export NIXOPS_DEPLOYMENT="$DeploymentUuid"
diff --git a/nixops/scripts/setup b/nixops/scripts/setup
index cfa8d64..55dd9d9 100755
--- a/nixops/scripts/setup
+++ b/nixops/scripts/setup
@@ -135,6 +135,7 @@ if nix show-config --json | jq -e '.sandbox.value == "true"' >/dev/null; then
135fi 135fi
136 136
137DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 137DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
138source $(dirname $(dirname $DIR))/nix_path_env
138nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" 139nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
139export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 140export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
140export NIXOPS_DEPLOYMENT="$DeploymentUuid" 141export NIXOPS_DEPLOYMENT="$DeploymentUuid"