nixos/facter: add core library and system detection
This adds foundational functionality for nixos-facter hardware detection: - lib.nix: Internal helper functions for querying facter reports - hasCpu/hasAmdCpu/hasIntelCpu: CPU vendor detection - collectDrivers: Extract driver_modules from hardware entries - toZeroPaddedHex: Format USB device IDs (for fingerprint matching) - system.nix: Auto-detect nixpkgs.hostPlatform from facter report Automatically sets the correct platform (x86_64-linux, aarch64-linux, etc.) based on the hardware report, reducing manual configuration. This builds on the base infrastructure added in PR #450303 and provides the foundation for upcoming hardware detection modules (boot, networking, graphics, etc.). Part of the incremental upstreaming effort from: https://github.com/nix-community/nixos-facter-modules
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./system.nix
|
||||
];
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ mic92 ];
|
||||
|
||||
options.hardware.facter = with lib; {
|
||||
|
||||
Reference in New Issue
Block a user