aboutsummaryrefslogtreecommitdiff
path: root/nix/generate-keys.sh
diff options
context:
space:
mode:
authorKumar Damani <me@kumardamani.net>2026-07-01 04:09:21 +0000
committerKumar Damani <me@kumardamani.net>2026-07-01 04:12:25 +0000
commit02926f70770ceb90cf382da2b54f888ba969f423 (patch)
tree0a7cc1fc1c68ae91ae49070bea5cd3708b875819 /nix/generate-keys.sh
parentbc1ad567d2eac46088285ed7d2d688fffc91a82f (diff)
nix based config
Diffstat (limited to 'nix/generate-keys.sh')
-rwxr-xr-xnix/generate-keys.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/nix/generate-keys.sh b/nix/generate-keys.sh
new file mode 100755
index 0000000..611d931
--- /dev/null
+++ b/nix/generate-keys.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# Generate a host key for a specific host
+set -euo pipefail
+
+HOST="$1"
+mkdir -p "./host-keys/${HOST}"
+ssh-keygen -t ed25519 -f "./host-keys/${HOST}/ssh_host_ed25519_key" -N ""
+echo "✅ Generated host key for ${HOST}"
+echo ""
+echo "👉 Derive age public key with:"
+# echo " cat ./host-keys/${HOST}/ssh_host_ed25519_key.pub | nix run nixpkgs#ssh-to-age"
+echo " cat ./host-keys/${HOST}/ssh_host_ed25519_key.pub | ssh-to-age"