Adding a host by hand¶
The installer is the normal path (see the quickstart), but a host is just files — nothing about it requires the wizard.
hosts/example/ is the reference shape. Copy it:
Then edit, in order:
config.nix— the bundle list (uncomment what you want; every bundle is listed, see the reference),locale, andbootTheme.default.nix— usually justnetworking.hostNameneeds to change; the imports (locale module, core profiles) stay as-is unless you're changing locale.hardware.nix— real hardware needs real detection. The shipped version is a generic virtio/UEFI profile for VM testing; for bare metal, replace it with whatnixos-generate-configproduces on the target (or adapt from a real host'shardware.nixif you're migrating one). Either way, replacenetworking.hostIdwith a fresh value (head -c 8 /etc/machine-idon the target) — the example's own value is exactly that, an example, and ZFS needs every host to have a different one.disks.nix— pick a storage template (see Storage modes and Architecture) and set the real device path(s).users/<name>.nix— copyusers/example.nix, set a real username and your own SSH public key(s).hosts/fleet.nix— add an entry if you want this host known to others (see Administration); skip this entirely for a single standalone machine.
Then build it:
gisnix update resolves hosts through hosts/fleet.nix, so give the
host an entry there (step 6) even for a standalone machine;
sudo nixos-rebuild switch --flake .#myhost works without one.
Registering a test¶
tests/test-example.nix is the pattern for a NixOS integration test — copy
it, point _module.args.hostname and the imported user file at your host,
and add an entry to tests.nix so nix flake check picks it up.