]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/scripts/with_env
Migrate to morph as a replacement to nixops
[perso/Immae/Config/Nix.git] / nixops / scripts / with_env
index 9882f787f120c855a8b291bdf534d24356c143b1..f8e5537b43423b3ac0362d79bb8b9226f502d3ac 100755 (executable)
@@ -5,12 +5,12 @@ if [ -z "$NIXOPS_ENV_LOADED" ]; then
   exit 1;
 fi
 
+umask 0077
 TEMP=$(mktemp -d /tmp/XXXXXX-nixops-files)
 chmod go-rwx $TEMP
 
 finish() {
   rm -rf "$TEMP"
-  nixops set-args --unset privateFiles
 }
 
 trap finish EXIT
@@ -21,6 +21,8 @@ files=$(pass ls Nixops/files | sed -e '1d' -e 's/^.* //')
 for file in $files; do
   pass show "Nixops/files/$file" > $TEMP/$file
 done
-nixops set-args --argstr privateFiles "$TEMP"
+
+export NIX_PATH="privateFiles=$TEMP:$NIX_PATH"
+export SSH_IDENTITY_FILE="$TEMP/id_ed25519"
 
 "$@"