From 6687852904e17b62b7a9e483848bf505670c6dc0 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 11 Aug 2020 09:41:20 -0300 Subject: nixos-update.sh: Remove /tmp/tmp.nix files and pipe directly into file --- nixos-update.sh | 3 +-- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3