aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-11 09:41:20 -0300
committerEuAndreh <eu@euandre.org>2020-08-11 09:41:20 -0300
commit6687852904e17b62b7a9e483848bf505670c6dc0 (patch)
tree6070d643491a748896133ab8d5e8e05959f3c63d
parentREADME.md: Remove comments from sample nix configuration (diff)
downloadtoph-6687852904e17b62b7a9e483848bf505670c6dc0.tar.gz
toph-6687852904e17b62b7a9e483848bf505670c6dc0.tar.xz
nixos-update.sh: Remove /tmp/tmp.nix files and pipe directly into file
-rwxr-xr-xnixos-update.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/nixos-update.sh b/nixos-update.sh
index d8a3750..8919a99 100755
--- a/nixos-update.sh
+++ b/nixos-update.sh
@@ -4,6 +4,5 @@
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
-envsubst < vps-configuration.env.nix | ssh "$TLD" 'cat > /tmp/tmp.nix'
-echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S mv /tmp/tmp.nix /etc/nixos/configuration.nix
+cat <(echo "${USER_PASSWORD}") <(envsubst < vps-configuration.env.nix) | ssh "$TLD" sudo -S 'cat > /etc/nixos/configuration.nix'
echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S -i nixos-rebuild switch --upgrade