diff options
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/README.md | 17 | ||||
| -rwxr-xr-x | nix/generate-keys.sh | 3 |
2 files changed, 3 insertions, 17 deletions
diff --git a/nix/README.md b/nix/README.md index 95cd4ac..920e9d3 100644 --- a/nix/README.md +++ b/nix/README.md @@ -28,25 +28,8 @@ Convert to Proxmox Template: ssh lan.hesh 'qm template 104' ``` -Run TF as usual using clone against the Template. -```sh -cd ../terraform -source con.env -tofu plan -out=tfplan -tofu apply tfplan -``` - ## Add Host -Scaffold a new host (host keys, `.sops.yaml`, `flake.nix`, `per-host/`, secrets, TF VM if absent, `~/.ssh/config`, Hosts section) and print the exact cmds to create the VM and deploy: -```sh -./add.sh <HOST_NAME> # interactive for cpu/mem/disk/vlan -./add.sh <HOST_NAME> --cpu 1 --mem 1024 --disk 10G --vlan 30 -``` - -Defaults for cpu/mem/disk/vlan are taken from `monitoring-2`. If the VM already exists in TF it is left alone. - -The manual equivalent, if needed: ```sh ./generate-keys.sh <HOST_NAME> 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 "" |
