aboutsummaryrefslogtreecommitdiff
path: root/nix/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'nix/README.md')
-rw-r--r--nix/README.md23
1 files changed, 20 insertions, 3 deletions
diff --git a/nix/README.md b/nix/README.md
index ab3a339..95cd4ac 100644
--- a/nix/README.md
+++ b/nix/README.md
@@ -38,15 +38,27 @@ tofu apply tfplan
## Add Host
-Copy `per-host/<EXISTING_HOST>` to `per-host/<HOST_NAME>`.
+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
+```
-Modify the `per-host/<HOST_NAME>/configuration.nix` accordingly.
+Defaults for cpu/mem/disk/vlan are taken from `monitoring-2`. If the VM already exists in TF it is left alone.
-Generate host-keys, and `age` key for the host.
+The manual equivalent, if needed:
```sh
./generate-keys.sh <HOST_NAME>
+
+cat ./host-keys/<HOST_NAME>/ssh_host_ed25519_key.pub | ssh-to-age
```
+Copy the `age` key to the `.sops.yaml` config.
+
+Copy `per-host/<EXISTING_HOST>` to `per-host/<HOST_NAME>`.
+
+Modify the `per-host/<HOST_NAME>/configuration.nix` accordingly.
+
## Secrets w/ `sops`
Edit the `.sops.yaml` to include the host's age key.
@@ -171,3 +183,8 @@ sudo garage bucket create <BUCKET_NAME>
sudo garage bucket website --allow <BUCKET_NAME>
sudo garage key create site-uploader
```
+
+### monitoring-2
+
+For monitoring.
+