Hosts
This repo manages both NixOS and nix-darwin machines from one codebase. A host is a concrete machine definition. If a package builds software and a module defines reusable behavior, a host chooses the exact combination for one machine.
Hosts are intentionally thin. Shared behavior belongs in modules and overlays, while hosts/<name>/configuration.nix contains the machine-specific decisions.
Key Files
hosts/constants.nix: host names, machine groups, ports, key material, shared constants.hosts/common.nix: shared NixOS defaults.hosts/common_darwin.nix: shared darwin defaults.hosts/<name>/configuration.nix: per-host config.
Host Families
- NixOS hosts have a
hardware-configuration.nixand build through.#nixosConfigurations.<host>.config.system.build.toplevel. - nix-darwin hosts build through
.#darwinConfigurations.<host>.system.
Host Vs Module
- A host is specific, one machine, one set of choices.
- A module is reusable, something several hosts can import.
How To Read This Layer
- Start with
hosts/constants.nix. - Read
hosts/common.nixorhosts/common_darwin.nix. - Open one concrete host directory under
hosts/. - Follow any imported modules into
hosts/modules/*.
For one concrete package -> module -> host walkthrough, see Case Study: poglets.
How To Test Changes
bash
# nixos
nix build .#nixosConfigurations.<host>.config.system.build.toplevel
# darwin
nix build .#darwinConfigurations.<host>.systemComplete Inventory
For the full generated host list, see Generated Host Index.