Adopt nixos-facter so host hardware facts are generated data, not a hand-written module #13
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
allod/archetypes#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A machine's non-disk hardware facts currently arrive as a hand-maintained Nix module in the inventory data repo, so standing up a new host means running
nixos-generate-config, stripping the filesystem entries by hand, and pasting the remainder intohosts/<name>/hardware.nix. Adoptingnixos-facterturns that into generated data, which is what the inventory repo is for.Primary goals:
facter.jsonreport underinventory/hosts/<name>/instead of a hand-edited Nix module, matching the repo's role as the machine-facts owner.nixos-anywhere --generate-hardware-config nixos-facterwrites the report during install, so there is no generate-strip-paste round trip.Current state
mkHypervisorimportsmachines.${name}.hardware(flake.nix:250), which resolves to a hand-written module in the consumer's inventory. That module carriesboot.initrd.availableKernelModules,boot.kernelModules,nixpkgs.hostPlatform, and CPU microcode/firmware settings. Since disko now owns disk topology, filesystem entries no longer belong there — but the file is still authored by hand fromnixos-generate-configoutput with the filesystem parts deleted.nixos-facteris not present anywhere in the stack: no input inarchetypes,vm,nexus, or any data repo, and nohardware.facter.reportPathanywhere. Sonixos-anywhere's--generate-hardware-config nixos-factercannot currently be used against a host built by this framework.Proposed shape
Structurally identical to the disko wiring in issue #12:
archetypes/flake.nixgains anixos-facter-modulesinput and adds the module tomkHypervisor's list, alongsidedisko.nixosModules.disko.hosts/<name>/facter.jsonplushardware.facter.reportPathin the hardware module.boot.initrd.availableKernelModulesand friends fall away for machines that adopt it.Adoption should be per-machine rather than a flag day: a machine with a working hand-written module keeps it until someone has a reason to regenerate.
Why this is not urgent
The value is concentrated in machines whose hardware is not already known. For a host that is a hardware clone of an existing one, the existing machine's module list is empirically known-good — it boots — which is stronger evidence than fresh detection. Adopting facter during a first bare-metal validation would mean testing detection output at the same time as the disk layout and the install mechanism, with no way to attribute a failure.
Scope
In scope: the framework input and module wiring, the inventory-side data convention, and documenting the per-machine adoption path.
Out of scope: migrating existing machines, and any change to disk topology — that is disko's, and the two are independent.