1.2 KiB
1.2 KiB
Steps to add a new host
- Generate an SSH host key to be used for secrets
ssh-keygen -t ed25519 -f /tmp/ssh_host_ed25519_key -C ""
- Go to borgmatic.com, add the generated SSH key and create a new repository
- Add a new host entry to nix-secrets/secrets.nix
- Generate a repository passphrase in nix-secrets
- Commit nix-secrets and run
nix flake update
in nix-config - Add a README.md and default.nix suited to the host
- Define (or generate with
nixos-generate-config
) a hardware-configuration.nix - Define the disk layout to be used by disko
- Commit nix-config
- Boot the NixOS installer
- Copy the generated SSH host key to
/etc/ssh
- Run
nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> root@<ip address>
Post install
The backup and Tailscale modules won't work until the following steps are completed.
- Run
sudo borgmatic init --encryption repokey-blake2
- Restart
borgmatic
- Run
sudo tailscale up --login-server https://headscale.vimium.net
- Visit the URL, then SSH onto
vps1
and runheadscale --user mesh nodes register --key <key>
- (Optionally) Give the Tailscale node a friendly name with
headscale node rename -i <index> <hostname>