nixpkgs/nixos/modules/hardware/facter/default.nix
Jörg Thalheim cb883c36e3 nixos/facter: add boot and storage detection
This adds automatic kernel module detection for boot-critical hardware:

- disk.nix: Detects and loads kernel modules for storage controllers
  Auto-detects modules for: disk controllers, storage controllers,
  and FireWire controllers (for FireWire-attached disks).
  Modules are automatically added to boot.initrd.availableKernelModules.

- keyboard.nix: Detects USB controller drivers for keyboard support
  Ensures USB HID drivers are loaded in initrd for keyboard access
  during boot (critical for LUKS password entry, etc.).

Follow up to #454237.
Part of incremental upstreaming from nixos-facter-modules.
2025-10-23 12:47:17 +02:00

47 lines
1.1 KiB
Nix

{
lib,
config,
...
}:
{
imports = [
./disk.nix
./keyboard.nix
./system.nix
];
meta.maintainers = with lib.maintainers; [ mic92 ];
options.hardware.facter = with lib; {
report = mkOption {
type = types.attrsOf types.anything;
default =
if config.hardware.facter.reportPath == null then
{ }
else
builtins.fromJSON (builtins.readFile config.hardware.facter.reportPath);
defaultText = "A JSON import from config.hardware.facter.reportPath (if not null), {} otherwise.";
description = ''
Hardware report data generated by nixos-facter.
See <https://nix-community.github.io/nixos-facter/> for more information.
'';
};
reportPath = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
Path to a hardware report generated by nixos-facter.
To generate a report, run the following as root:
```
nix-shell -p nixos-facter --run nixos-facter > facter.json
```
See <https://nix-community.github.io/nixos-facter/> for more information.
'';
};
};
}