aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2025-01-01 03:57:15 +0200
committerZhongheng Liu <z.liu@outlook.com.gr>2025-01-01 03:57:15 +0200
commit4c07b4d0a4e2da717aa95761d475d0ce0a387be5 (patch)
treeeeecd8a4ad49c222d8a5eb92d02bf2ee44420c7a
parent71b70ecb3a3772c60948a433ee1dead366cef404 (diff)
downloadnixos-configuration-4c07b4d0a4e2da717aa95761d475d0ce0a387be5.tar.gz
nixos-configuration-4c07b4d0a4e2da717aa95761d475d0ce0a387be5.tar.bz2
nixos-configuration-4c07b4d0a4e2da717aa95761d475d0ce0a387be5.zip
feat: UNTESTED: quick and dirty deploy script
-rw-r--r--deploy.sh18
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
+