From 5ba582cabd86036de1f514cd715697ac80a88227 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 10 Aug 2020 14:15:46 -0300 Subject: Use password via stdin, and store the snapshot image configuration.nix --- nixos-update.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nixos-update.sh') diff --git a/nixos-update.sh b/nixos-update.sh index bcadfd6..b4deb7e 100755 --- a/nixos-update.sh +++ b/nixos-update.sh @@ -7,5 +7,6 @@ cd "$(dirname "${BASH_SOURCE[0]}")" git crypt unlock direnv allow -envsubst < vps-configuration.env.nix | ssh "$TLD" 'cat > /etc/nixos/configuration.nix' -ssh "$TLD" sudo nixos-rebuild switch --upgrade +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 +echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S -i nixos-rebuild switch --upgrade -- cgit v1.2.3