···8989If we lose enough nodes to break etcd quorum, the cluster has to be rebuilt
9090from scratch:
91919292-1. NixOS + k3s on replacement hardware (see [`nix/hosts/README.md`](nix/hosts/README.md)).
9292+1. NixOS + k3s on replacement hardware (see host definitions in [`nix/hosts`](nix/hosts)).
93932. `helmfile sync` infra + `cluster-tls` + `pg-shared` (the `needs:` chains
9494 resolve in correct order).
95953. Restore `pg-shared` from B2 — same as the recipe above, but use
···11-# 🖥️ Hosts
22-33-This directory contains the NixOS configurations for each of my devices. Each subdirectory corresponds to a specific host, encapsulating its unique setup and specifications.
44-55----
66-77-## 📂 Directory Structure
88-99-The `hosts/` directory is organized as follows:
1010-1111-```plaintext
1212-hosts/
1313-├── eterna/ # Beelink Mini S12 Pro
1414-├── jubilife/ # Custom Mini-ITX NAS
1515-├── pastoria/ # OVHcloud VPS
1616-├── snowpoint/ # Netcup VPS
1717-├── solaceon/ # Hetzner VPS
1818-└── twinleaf/ # Minimal installation ISO
1919-```
2020-2121----
2222-2323-## 🛠️ Provisioning New Devices
2424-2525-1. **Create host configuration**: duplicate an existing host directory under `hosts/` and rename it. Update `default.nix`, `disko.nix`, `hardware.nix`, etc. to match the device.
2626-2727-1. **Register the host**: add it to `nixosConfigurations` in `nix/modules/flake/nixos.nix`.
2828-2929-1. **Install NixOS** on the device using this flake. Secrets will not decrypt on first boot until the host's age key is a recipient.
3030-3131-1. **Add SSH host key as a sops recipient**: copy `/etc/ssh/ssh_host_ed25519_key.pub` from the new device into `keys/root_$HOSTNAME.pub`, then run `just sops-rekey` to regenerate `.sops.yaml` and re-encrypt every secret.
3232-3333-1. **Rebuild** on the new device. Secrets land at `/run/secrets/` (sops-nix).
3434-3535-1. **(Optional) Add a user key**: drop `~/.ssh/id_ed25519.pub` from the new device into `keys/$USER_$HOSTNAME.pub` and re-run `just sops-rekey` so the user can decrypt secrets too.
3636-3737----