Skip to content

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

Host Families

  • NixOS hosts have a hardware-configuration.nix and 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

  1. Start with hosts/constants.nix.
  2. Read hosts/common.nix or hosts/common_darwin.nix.
  3. Open one concrete host directory under hosts/.
  4. 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>.system

Complete Inventory

For the full generated host list, see Generated Host Index.