Steps to add a new server:
-
Install Nix on target host and add substituters to
/etc/nix/nix.conf -
Add a new configuration to this repo based on
nixos-generate-configresult on target host, with ssh and public keys configured -
Create
/etc/NIXOSand/etc/NIXOS_LUSTRATEon target host -
Run
sudo mkdir /boot.bak && sudo mv /boot/* /boot.bakon target host -
nixos-rebuild boot --flake '.#<new_server>' --target-host <new_server> --substitute-on-destination -
Reboot target host
-
Remove target host from
~/.ssh/known_hosts, because its keys are regenerated -
Reset root password for target host
-
Use SSH port forwarding to configure Syncthing for the first time
ssh -L 18384:127.0.0.1:8384 <new_server> -N- Set up Cloudflare Warp
warp-cli registration new
warp-cli mode proxy
warp-cli connect- Set up swap file and redeploy