Skip to content

Commit fb7b157

Browse files
committed
disk: don't expose list instead of enable option
the latter one is easier to introspect
1 parent 7bc4cd4 commit fb7b157

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

modules/nixos/disk.nix

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

5-
cfg = config.facter.detected.boot.disk;
65
inherit (config.facter) report;
76
in
87
{
9-
options.facter.detected.boot.disk.enable = lib.mkEnableOption "Enable Disk drivers in initrd" // {
10-
default = true;
11-
};
12-
13-
config =
14-
lib.mkIf cfg.enable {
15-
boot.initrd.availableKernelModules = facterLib.stringSet (
8+
options.facter.detected.boot.disk.kernelModules = lib.mkOption {
9+
type = lib.types.listOf lib.types.str;
10+
default = facterLib.stringSet (
1611
facterLib.collectDrivers (
1712
# A disk might be attached.
1813
(report.hardware.firewire_controller or [ ])
@@ -21,5 +16,12 @@ in
2116
++ (report.hardware.storage_controller or [ ])
2217
)
2318
);
24-
};
19+
description = ''
20+
List of kernel modules that are needed to access the disk.
21+
'';
22+
};
23+
24+
config = {
25+
boot.initrd.availableKernelModules = config.facter.detected.boot.disk.kernelModules;
26+
};
2527
}

0 commit comments

Comments
 (0)