diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-04-25 01:34:35 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-04-25 01:34:35 +0200 |
commit | 78e25e2ac542eceb33aa0d292397d5236dbb9df8 (patch) | |
tree | 1cb9cac067533926145461af6c2ec893693600c1 /nixops | |
parent | 9df76627240b567f8cbb00d1b429aa3541243558 (diff) | |
download | Nix-78e25e2ac542eceb33aa0d292397d5236dbb9df8.tar.gz Nix-78e25e2ac542eceb33aa0d292397d5236dbb9df8.tar.zst Nix-78e25e2ac542eceb33aa0d292397d5236dbb9df8.zip |
Fix nixops: allow keyFile to be a string in deployments
Diffstat (limited to 'nixops')
-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 "$@" |