diff options
Diffstat (limited to 'nixops/scripts/nixops_wrap')
-rwxr-xr-x | nixops/scripts/nixops_wrap | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap index e50b246..12f661a 100755 --- a/nixops/scripts/nixops_wrap +++ b/nixops/scripts/nixops_wrap | |||
@@ -5,16 +5,18 @@ if [ -z "$NIXOPS_CONFIG_PASS_SUBTREE_PATH" ]; then | |||
5 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" | 5 | echo "Please set NIXOPS_CONFIG_PASS_SUBTREE_PATH to the password-store subtree path" |
6 | exit 1; | 6 | exit 1; |
7 | fi | 7 | fi |
8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
9 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | ||
10 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | ||
11 | source $(dirname $(dirname $DIR))/nix_path_env | ||
12 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | ||
8 | 13 | ||
9 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) | 14 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) |
10 | chmod go-rwx $TEMP | 15 | chmod go-rwx $TEMP |
11 | 16 | ||
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 | 17 | # __noChroot: ssh-config-file requires relaxed |
15 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" | 18 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" |
16 | 19 | ||
17 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | ||
18 | 20 | ||
19 | finish() { | 21 | finish() { |
20 | rm -rf "$TEMP" | 22 | rm -rf "$TEMP" |
@@ -23,9 +25,6 @@ finish() { | |||
23 | 25 | ||
24 | trap finish EXIT | 26 | trap finish EXIT |
25 | 27 | ||
26 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | ||
27 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | ||
28 | |||
29 | # pass cannot "just" list files in a directory without showing a tree :( | 28 | # pass cannot "just" list files in a directory without showing a tree :( |
30 | files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //') | 29 | files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e 's/^.* //') |
31 | 30 | ||