Files
nixpkgs/nixos/modules/hardware/facter/keyboard.nix
andre4ik3 5dd1dff815 nixos/facter: add enable option
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.
2026-03-11 09:07:52 +00:00

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;
};
}