Skip to content

Commit fdf703e

Browse files
committed
also expose keyboard kernel modules as a list
1 parent fb7b157 commit fdf703e

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

modules/nixos/keyboard.nix

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22
let
33
facterLib = import ../../lib/lib.nix lib;
44

5-
cfg = config.facter.detected.boot.keyboard;
65
inherit (config.facter) report;
76
in
87
{
9-
options.facter.detected.boot.keyboard.enable =
10-
lib.mkEnableOption "Enable Keyboard support in the initrd"
11-
// {
12-
default = true;
13-
};
8+
options.facter.detected.boot.keyboard.kernelModules = lib.mkOption {
9+
type = lib.types.listOf lib.types.str;
10+
default = facterLib.collectDrivers (report.hardware.usb_controller or [ ]);
11+
example = [ "usbhid" ];
12+
description = ''
13+
List of kernel modules to include in the initrd to support the keyboard.
14+
'';
15+
};
1416

15-
config =
16-
lib.mkIf cfg.enable {
17-
boot.initrd.availableKernelModules = facterLib.stringSet (
18-
# Needed if we want to use the keyboard when things go wrong in the initrd.
19-
facterLib.collectDrivers (report.hardware.usb_controller or [ ])
20-
);
21-
};
17+
config = {
18+
boot.initrd.availableKernelModules = config.facter.detected.boot.keyboard.kernelModules;
19+
};
2220
}

0 commit comments

Comments
 (0)