mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 21:40:12 +00:00
The option defaults to `report != { }` instead of `reportPath != null`,
because since the report may be set externally using `report`, guarding
for `reportPath != null` breaks setups that set it externally, since
none of the modules take effect any longer.
22 lines
677 B
Nix
22 lines
677 B
Nix
{ lib, config, ... }:
|
|
let
|
|
facterLib = import ./lib.nix lib;
|
|
|
|
inherit (config.hardware.facter) report;
|
|
in
|
|
{
|
|
options.hardware.facter.detected.boot.keyboard.kernelModules = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
default = lib.uniqueStrings (facterLib.collectDrivers (report.hardware.usb_controller or [ ]));
|
|
defaultText = "hardware dependent";
|
|
example = [ "usbhid" ];
|
|
description = ''
|
|
List of kernel modules to include in the initrd to support the keyboard.
|
|
'';
|
|
};
|
|
|
|
config = lib.mkIf config.hardware.facter.enable {
|
|
boot.initrd.availableKernelModules = config.hardware.facter.detected.boot.keyboard.kernelModules;
|
|
};
|
|
}
|