Configuration for my network infrastructure.
whitelodge
: My VPS running NixOS.blacklodge
: My desktop computer running Pop!_OS.cooper
: Lenovo Thinkpad T14 Gen 2 running NixOS.gordon
: MacBook Air M3.bob
: Raspberry Pi 4 Model B running NixOS.hawk
: iPhone SE 2022.audrey
: MikroTik hAP ac lite TC running OpenWRT.
To define and deploy a machine (called twinpeaks
in this example), do the
following.
- Put its configuration under
machines/twinpeaks
. - Create an
outputs.nixosConfigurations.twinpeaks
block inflake.nix
. If necessary, define its network configuration inintranet/devices.nix
andintranet/wireguard.nix
. - Start the machine and its SSH server to generate an SSH host key.
- Obtain the host key.
$ ssh-keyscan <ip-address>
- Follow the instructions in the infra-secrets repository.
- SSH into the machine and enter a Nix shell with git (the flake setup needs
it).
$ nix shell nixpkgs#git
- Run
Explicitly setting the flake is only necessary during the initial deployment. Afterwards, the hostname will have been set and
# nixos-rebuild switch --flake 'github:tomaskala/infra#twinpeaks'
nixos-rebuild
will automatically select the matching flake.