Trimmed module lists
NixOS evaluates about 1,900 base modules for every host, used or not. A host with trimmedModules = true in the
reference fleet evaluates only the ones it needs: about 400.
The list is the closure of a learned core and the options the host defines. It filters module-list.nix itself,
so the order and the inline entries stay. The host passes it to nixosSystem as baseModules.
| Reference fleet: web-1, app-2 toplevel | CPU | Thunks | GC total |
|---|---|---|---|
| full list | 11.4 s | 14.57 M | 1.03 GB |
| trimmed list | 10.5 s | 13.21 M | 0.94 GB |
Three oracles
Section titled “Three oracles”modlist-same-drv: each trimmed toplevel has the samedrvPathas the full build.modlist-negative: the list without nginx fails for a host that runs nginx, and the same list with nginx builds.cost.sh: the trimmed eval uses at most 95% of the thunks.
platforms/nixos.nix The host sink: trimmed, full and own-pkgs builds.
modlist research How the lists are computed.