aboutsummaryrefslogtreecommitdiff
path: root/nix/generate-keys.sh
diff options
context:
space:
mode:
authorKumar Damani <me@kumardamani.net>2026-09-15 20:29:29 +0000
committerKumar Damani <me@kumardamani.net>2026-09-15 21:09:51 +0000
commit276c9bd2a751f90911689a37e3a86f4a26056e23 (patch)
tree626dd69d29a2a4f57a5dcdbc6738c8c12a98b606 /nix/generate-keys.sh
parent0b47dfe796edd63cf121c64e53de95dfc17c580d (diff)
automate adding new host flow
Diffstat (limited to 'nix/generate-keys.sh')
-rwxr-xr-xnix/generate-keys.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/nix/generate-keys.sh b/nix/generate-keys.sh
index 611d931..89484e7 100755
--- a/nix/generate-keys.sh
+++ b/nix/generate-keys.sh
@@ -2,6 +2,9 @@
# Generate a host key for a specific host
set -euo pipefail
+# Resolve paths relative to this script, not the caller's CWD
+cd -- "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"
+
HOST="$1"
mkdir -p "./host-keys/${HOST}"
ssh-keygen -t ed25519 -f "./host-keys/${HOST}/ssh_host_ed25519_key" -N ""