aboutsummaryrefslogtreecommitdiff
path: root/nixops/scripts/nixops_wrap
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-25 01:34:35 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-25 01:34:35 +0200
commit78e25e2ac542eceb33aa0d292397d5236dbb9df8 (patch)
tree1cb9cac067533926145461af6c2ec893693600c1 /nixops/scripts/nixops_wrap
parent9df76627240b567f8cbb00d1b429aa3541243558 (diff)
downloadNix-78e25e2ac542eceb33aa0d292397d5236dbb9df8.tar.gz
Nix-78e25e2ac542eceb33aa0d292397d5236dbb9df8.tar.zst
Nix-78e25e2ac542eceb33aa0d292397d5236dbb9df8.zip
Fix nixops: allow keyFile to be a string in deployments
Diffstat (limited to 'nixops/scripts/nixops_wrap')
-rwxr-xr-xnixops/scripts/nixops_wrap10
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
9TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) 9TEMP=$(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 )"
13nixops="$(nix-build --no-out-link -A nixops "$(dirname $(dirname $DIR))")/bin/nixops"
14
12finish() { 15finish() {
13 rm -rf "$TEMP" 16 rm -rf "$TEMP"
14 nixops set-args --unset privateFiles 17 $nixops set-args --unset privateFiles
15} 18}
16 19
17trap finish EXIT 20trap finish EXIT
18 21
19DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
20export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops" 22export NIXOPS_STATE="$(dirname $DIR)/state/eldiron.nixops"
21export NIXOPS_DEPLOYMENT="$DeploymentUuid" 23export NIXOPS_DEPLOYMENT="$DeploymentUuid"
22 24
@@ -26,9 +28,9 @@ files=$(pass ls $NIXOPS_CONFIG_PASS_SUBTREE_PATH/Nixops/files | sed -e '1d' -e '
26for file in $files; do 28for 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
28done 30done
29nixops set-args --argstr privateFiles "$TEMP" 31$nixops set-args --argstr privateFiles "$TEMP"
30 32
31source $(dirname $(dirname $DIR))/nix_path_env 33source $(dirname $(dirname $DIR))/nix_path_env
32# __noChroot: ssh-config-file requires relaxed 34# __noChroot: ssh-config-file requires relaxed
33export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH" 35export NIX_PATH="ssh-config-file=$(dirname $DIR)/ssh/config:$NIX_PATH"
34nixops "$@" 36$nixops "$@"