]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/scripts/with_env
Add environment file instead of hardcoding everything in makefiles
[perso/Immae/Config/Nix.git] / nixops / scripts / with_env
index 26e74b5f6d77b2f1851c9159f249344ad7f17b6c..9882f787f120c855a8b291bdf534d24356c143b1 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
-if [ -z "$NIXOPS" ]; then
-  echo "Please set NIXOPS to the nixops command"
+if [ -z "$NIXOPS_ENV_LOADED" ]; then
+  echo "Please load the environment with direnv"
   exit 1;
 fi
 
@@ -10,7 +10,7 @@ chmod go-rwx $TEMP
 
 finish() {
   rm -rf "$TEMP"
-  $NIXOPS set-args --unset privateFiles
+  nixops set-args --unset privateFiles
 }
 
 trap finish EXIT
@@ -21,6 +21,6 @@ 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"
+nixops set-args --argstr privateFiles "$TEMP"
 
 "$@"