summary refs log tree commit diff stats
path: root/scripts
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-25 16:21:32 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-25 16:46:27 +0100
commit1cdec23e1a3a7f06a0a30cf036d7355ea601fc40 (patch)
tree8f0cfb696709e165c66f8a0b9efddf28bdc746e9 /scripts
parentbuild(scripts/mk_network_config): Init (diff)
downloadnixos-server-1cdec23e1a3a7f06a0a30cf036d7355ea601fc40.zip
build(scripts/deploy): Init
This documents the commands used for the first deployment (i.e., with a
full, disko-driven, disk formatting step).
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/deploy.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/deploy.sh b/scripts/deploy.sh
new file mode 100755
index 0000000..5c7b0e6
--- /dev/null
+++ b/scripts/deploy.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+
+[ "$#" -ne 2 ] && {
+    echo "Usage: $1 <ssh url> <host_name>"
+    exit 2
+}
+ssh_url="$1"
+host_name="$2"
+root="$(git rev-parse --show-toplevel)"
+
+nix run github:numtide/nixos-anywhere -- \
+    --flake ".#$host_name" \
+    --target-host "$ssh_url" \
+    --generate-hardware-config nixos-generate-config "$root/hosts/by-name/$host_name/hardware_config_$ssh_url.nix"
+
+# vim: ft=sh