diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-01-01 03:57:15 +0200 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-01-01 03:57:15 +0200 |
commit | 4c07b4d0a4e2da717aa95761d475d0ce0a387be5 (patch) | |
tree | eeecd8a4ad49c222d8a5eb92d02bf2ee44420c7a | |
parent | 71b70ecb3a3772c60948a433ee1dead366cef404 (diff) | |
download | nixos-configuration-4c07b4d0a4e2da717aa95761d475d0ce0a387be5.tar.gz nixos-configuration-4c07b4d0a4e2da717aa95761d475d0ce0a387be5.tar.bz2 nixos-configuration-4c07b4d0a4e2da717aa95761d475d0ce0a387be5.zip |
feat: UNTESTED: quick and dirty deploy script
-rw-r--r-- | deploy.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..45cf030 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env sh + +# Deploys the configuation to your machine + +TMP_DIRNAME="/tmp/nix-config" +GIT_REMOTE_SRC=$1 +NIX_HOST="<YOUR_HOSTNAME_HERE>" +echo "Going to clone $GIT_REMOTE_SRC into $TMP_DIRNAME" +mkdir "$TMP_DIRNAME" + +git clone "$GIT_REMOTE_SRC" "$TMP_DIRNAME" +prev=$PWD +cd "$TMP_DIRNAME" || return +echo "Now going to build nix configuration for $NIX_HOST to switch on next boot" +sudo nixos-rebuild --flake .#$NIX_HOST boot + +cd "$prev" || return + |