aboutsummaryrefslogtreecommitdiff
path: root/nixops/scripts/with_env
diff options
context:
space:
mode:
Diffstat (limited to 'nixops/scripts/with_env')
-rwxr-xr-xnixops/scripts/with_env6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixops/scripts/with_env b/nixops/scripts/with_env
index 9882f78..f8e5537 100755
--- a/nixops/scripts/with_env
+++ b/nixops/scripts/with_env
@@ -5,12 +5,12 @@ if [ -z "$NIXOPS_ENV_LOADED" ]; then
5 exit 1; 5 exit 1;
6fi 6fi
7 7
8umask 0077
8TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files) 9TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
9chmod go-rwx $TEMP 10chmod go-rwx $TEMP
10 11
11finish() { 12finish() {
12 rm -rf "$TEMP" 13 rm -rf "$TEMP"
13 nixops set-args --unset privateFiles
14} 14}
15 15
16trap finish EXIT 16trap finish EXIT
@@ -21,6 +21,8 @@ files=$(pass ls Nixops/files | sed -e '1d' -e 's/^.* //')
21for file in $files; do 21for file in $files; do
22 pass show "Nixops/files/$file" > $TEMP/$file 22 pass show "Nixops/files/$file" > $TEMP/$file
23done 23done
24nixops set-args --argstr privateFiles "$TEMP" 24
25export NIX_PATH="privateFiles=$TEMP:$NIX_PATH"
26export SSH_IDENTITY_FILE="$TEMP/id_ed25519"
25 27
26"$@" 28"$@"