diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-04-27 14:36:33 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-04-27 14:36:33 +0200 |
commit | 11234d0798eeb56b2a09bfc66925e782ace465e3 (patch) | |
tree | a0f00c1f7b9b9aaa168763339dc703e0fc5569dc /nixops | |
parent | 941bfb6ff039b6bfd94cc5aec8a0ef6dd1b82f36 (diff) | |
download | Nix-11234d0798eeb56b2a09bfc66925e782ace465e3.tar.gz Nix-11234d0798eeb56b2a09bfc66925e782ace465e3.tar.zst Nix-11234d0798eeb56b2a09bfc66925e782ace465e3.zip |
Source environemnt before building nixops in scripts
Diffstat (limited to 'nixops')
-rwxr-xr-x | nixops/scripts/nixops_wrap | 7 | ||||
-rwxr-xr-x | nixops/scripts/pull_deployment | 1 | ||||
-rwxr-xr-x | nixops/scripts/push_deployment | 1 | ||||
-rwxr-xr-x | nixops/scripts/setup | 1 |
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) | |||
10 | chmod go-rwx $TEMP | 10 | chmod go-rwx $TEMP |
11 | 11 | ||
12 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 12 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
13 | source $(dirname $(dirname $DIR))/nix_path_env | ||
14 | # __noChroot: ssh-config-file requires relaxed | ||
15 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" | ||
16 | |||
13 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | 17 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" |
14 | 18 | ||
15 | finish() { | 19 | finish() { |
@@ -30,7 +34,4 @@ for file in $files; do | |||
30 | done | 34 | done |
31 | $nixops set-args --argstr privateFiles "$TEMP" | 35 | $nixops set-args --argstr privateFiles "$TEMP" |
32 | 36 | ||
33 | source $(dirname $(dirname $DIR))/nix_path_env | ||
34 | # __noChroot: ssh-config-file requires relaxed | ||
35 | export 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 | |||
8 | fi | 8 | fi |
9 | 9 | ||
10 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 10 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
11 | source $(dirname $(dirname $DIR))/nix_path_env | ||
11 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | 12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" |
12 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 13 | export 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 | |||
8 | fi | 8 | fi |
9 | 9 | ||
10 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 10 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
11 | source $(dirname $(dirname $DIR))/nix_path_env | ||
11 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | 12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" |
12 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 13 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
13 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 14 | export 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 | |||
135 | fi | 135 | fi |
136 | 136 | ||
137 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | 137 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
138 | source $(dirname $(dirname $DIR))/nix_path_env | ||
138 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | 139 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" |
139 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 140 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
140 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 141 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" |