14 lines
1.0 KiB
Plaintext
14 lines
1.0 KiB
Plaintext
* boot target from NixOS installer USB
|
|
* passwd for nixos user on target
|
|
* note IP address, test that ssh as nixos works
|
|
* on target: nixos-generate-config --no-filesystems, copy to base host
|
|
* on target: dd if=/dev/random of=/dev/disk/by-id/<usb drive for encryption key> bs=4096 count=1
|
|
* on target: dd if=/dev/disk/by-id/<usb drive for encryption key> of=key.bin bs=4096 count=1
|
|
* copy key.bin to hosts/<target>/
|
|
* use the generated config to create new config in hosts/<target>
|
|
* set the actual device IDs in hosts/<target>/default.nix
|
|
* on base host: nix run github:nix-community/nixos-anywhere -- --flake '.#<target>' nixos@<target IP>
|
|
* after confirmed working, update hosts/<target>/default.nix to set keyFile to /dev/sdX (otherwise when the USB drive fails it's harder to replace)
|
|
* if replacing failed host in place, update key in .sops.yaml with the output from "ssh-keyscan <host> | ssh-to-age" then "sops updatekeys secrets/*.yaml"
|
|
** if installing new host, do the same for install then again after the first reboot (the installer key is not persisted)
|