refactor(deploy): generalize to any config, all params mandatory (no defaults)

This commit is contained in:
erik
2026-07-13 01:05:28 +02:00
parent 946c44f1d3
commit ec309c8fe1
2 changed files with 54 additions and 36 deletions
+17 -5
View File
@@ -67,14 +67,26 @@ an installer, partitions via disko, installs.
Manual alternative (USB ISO): boot installer, `disko` the disk, then
`nixos-install --flake .#jupiter`.
## Rebuild after changes (the daily loop)
## Deploy (the `./deploy` wrapper)
All arguments mandatory — no default host, no default config.
```
# from laptop, build + activate on jupiter over SSH:
nixos-rebuild switch --flake .#jupiter \
--target-host darman@jupiter --use-remote-sudo
./deploy kexec <host> # headless kexec into a RAM installer (RO-root box)
./deploy install <config> <host> # first install; wipes OS disk, ships host key
./deploy switch <config> <host> # rebuild + activate on a running host
./deploy boot|test <config> <host> # stage for next boot / activate without boot entry
```
Rollback: `nixos-rebuild switch --rollback`, or pick a prior generation at boot.
`<config>` is a `nixosConfigurations` name (`jupiter`, `vps`). Its pre-generated
SSH host key lives at `~/.config/homelab/<config>/ssh_host_ed25519_key`.
Examples:
```
./deploy switch jupiter jupiter.sol
./deploy install vps 159.195.64.117
```
Rollback: `nixos-rebuild switch --rollback` on the host, or pick a prior
generation at boot.
## Adding a service