diff options
-rwxr-xr-x | scripts/deploy | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/scripts/deploy b/scripts/deploy index b0797be..5c26030 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -15,15 +15,6 @@ fi DIR="$(dirname "$FILE")" -if [ -f "$DIR"/machines.scm ]; then - OS=guix -elif [ -f "$DIR"/configuration.nix ]; then - OS=nix -else - printf 'Uknown OS type of "%s"\n' "$NAME" >&2 - exit 2 -fi - terraform apply "$DIR" TLD="$(cat "$DIR"/tld.txt)" @@ -36,9 +27,12 @@ chmod -R 755 $DIRS" rsync -avzP opt "$TLD":/ -if [ "$OS" = 'guix' ]; then +if [ -f "$DIR"/machines.scm ]; then guix deploy "$DIR"/machines.scm -elif [ "$OS" = 'nix' ]; then +elif [ -f "$DIR"/configuration.nix ]; then scp "$DIR"/configuration.nix "$TLD":/etc/nixos/ ssh "$TLD" sudo nixos-rebuild switch +else + printf 'Uknown OS type of "%s"\n' "$NAME" >&2 + exit 2 fi |