Steps to add a new server:
-
Install Nix on target host with flakes enabled, 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, and adapt with preservation -
Create
/etc/NIXOSand/nixos/etc/NIXOSon target host (also copy ssh keys here to prevent step 7?) -
Run
sudo tar acvf boot.tar.gz /booton target host, and backupboot.tar.gzlocally -
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