We have all used nixos-generate-config, and it has provided us with good service over the years. With our new project, nixos-factor (mostly written by @brianmcgee), we are exploring a new area by providing more extensive raw hardware information in a JSON hardware report and doing the actual configuration in a NixOS module. Our goal is to replace a significant portion of the manual configuration currently done in nixos-hardware profiles, leaving only hardware quirks that cannot be auto-detected.
When I first started, I tried wrapping libusb, etc. It didn’t take me long, though, to stumble across GitHub - openSUSE/hwinfo: Hardware information tool, which does all the heavy lifting on the hardware scanning side and exposes a C lib. So I decided for a few reasons it was better to wrap hwinfo for the hardware section you see in the report.
The idea is to start building up hardware reports for things like Hetzner machine types, laptop models and so on. We could even have an activation script that runs the scan on startup and shouts if there are any changes when compared to the report that was used in the NixOS config.
I can see a future where these reports could be submitted to various hardware databases too.
We haven’t started compiling reports yet; we’re still evolving the report format and increasing the coverage of what it captures. Once it steady states, which I hope to reach in the next few weeks, we can start compiling hardware reports.
I’ll drop an update on Discourse when we get to that point.
The current set of NixOS modules replicates some of the behaviour found in nixos-generate-config. In the long term, we hope to close the functional gaps and upstream.
Huh, I wonder if it’ll require an RFC to get this fully in, considering it’s a pretty big change (also would this deprecate NixOS-hardware?) Ideally, if it so, this should go into the nixpkgs instead of being spun up into another repo like nixos-hardware was.
I don’t think nixos-hardware would fully go away, but could be simplified a lot. We want to use sku information to automatically import the right machine profiles from nixos-hardware.