diff options
Diffstat (limited to 'nixops/scripts/nixops_wrap')
-rwxr-xr-x | nixops/scripts/nixops_wrap | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nixops/scripts/nixops_wrap b/nixops/scripts/nixops_wrap index 3a894f9..e4f5dc5 100755 --- a/nixops/scripts/nixops_wrap +++ b/nixops/scripts/nixops_wrap | |||
@@ -9,14 +9,16 @@ fi | |||
9 | TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) | 9 | 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 )" | ||
13 | nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops" | ||
14 | |||
12 | finish() { | 15 | finish() { |
13 | rm -rf "$TEMP" | 16 | rm -rf "$TEMP" |
14 | nixops set-args --unset privateFiles | 17 | $nixops set-args --unset privateFiles |
15 | } | 18 | } |
16 | 19 | ||
17 | trap finish EXIT | 20 | trap finish EXIT |
18 | 21 | ||
19 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
20 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" | 22 | export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" |
21 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" | 23 | export NIXOPS_DEPLOYMENT="$DeploymentUuid" |
22 | 24 | ||
@@ -26,9 +28,9 @@ files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e ' | |||
26 | for file in $files; do | 28 | for file in $files; do |
27 | pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files/$file" > $TEMP/$file | 29 | pass show "$NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files/$file" > $TEMP/$file |
28 | done | 30 | done |
29 | nixops set-args --argstr privateFiles "$TEMP" | 31 | $nixops set-args --argstr privateFiles "$TEMP" |
30 | 32 | ||
31 | source $(dirname $(dirname $DIR))/nix_path_env | 33 | source $(dirname $(dirname $DIR))/nix_path_env |
32 | # __noChroot: ssh-config-file requires relaxed | 34 | # __noChroot: ssh-config-file requires relaxed |
33 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" | 35 | export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" |
34 | nixops "$@" | 36 | $nixops "$@" |