diff options
| author | EuAndreh <eu@euandre.org> | 2020-08-12 22:41:34 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2020-08-12 22:41:34 -0300 |
| commit | d4e533667a36df94272f55ab428b2a73356be88a (patch) | |
| tree | 9ed1bfbe55f69726fc7c8e5bd3656aabeb174ba9 /nixos-switch.sh | |
| parent | vps-configuration.env.nix: Finish working Nextcloud installation (diff) | |
| download | toph-d4e533667a36df94272f55ab428b2a73356be88a.tar.gz toph-d4e533667a36df94272f55ab428b2a73356be88a.tar.xz | |
Rename: nixos-update.sh->nixos-switch.sh, terraform-update.sh->terraform-apply.sh
Diffstat (limited to 'nixos-switch.sh')
| -rwxr-xr-x | nixos-switch.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos-switch.sh b/nixos-switch.sh new file mode 100755 index 0000000..856acb4 --- /dev/null +++ b/nixos-switch.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash +# shellcheck shell=bash +set -Eeuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +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 nix-channel --add "https://nixos.org/channels/nixos-${SYSTEM_STATE_VERSION}" nixos +echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S -i nixos-rebuild switch --upgrade |
