Build Modes
Choose where the Nix closure is built: locally on the machine running Panix (default), or remotely on the installable’s first machine.
Local Mode (Default)
Section titled “Local Mode (Default)”Builds run on the machine executing Panix:
nix build --no-link --print-out-paths --keep-going <flake-url>#<installable>Panix also passes the experimental features flags and any configured nix command flags; the same applies to the remote command below. The closure is then transferred to each target machine via nix copy. Machines whose hostname matches local_machine_hostname skip the transfer entirely: they share the local store.
Remote Mode
Section titled “Remote Mode”Builds run on the installable’s first machine via the Nix remote store protocol:
nix build --eval-store auto --store ssh-ng://<first-machine> --option builders "" --no-link --print-out-paths --keep-going <flake-url>#<installable>Use remote mode when:
- The target machine has more resources (CPU/RAM) than the machine running Panix
- The machine running Panix and the targets are not the same architecture
Configuration
Section titled “Configuration”fleet: flakes: my-flake: url: <url> installables: nixosConfigurations: my-server: nix: build_mode: remote machines: builder-and-target: # first machine: remote builder and target ssh: hostname: 192.168.1.100 target-2: # closure copied from builder-and-target ssh: hostname: 192.168.1.101build_mode can be set at fleet, flake, or installable level, inherited like other nix options. It cannot be set at machine level, since build is a per-installable phase shared by the installable’s machines.
Advanced Distributed Builds
Section titled “Advanced Distributed Builds”For advanced distributed builds: