File tree Expand file tree Collapse file tree 1 file changed +11
-19
lines changed Expand file tree Collapse file tree 1 file changed +11
-19
lines changed Original file line number Diff line number Diff line change 3
3
4
4
cfg = config . facter . boot ;
5
5
inherit ( config . facter ) report ;
6
+ collectDriver = list : lib . foldl' ( lst : value : lst ++ value . driver_modules or [ ] ) [ ] list ;
7
+ stringSet = list : builtins . attrNames ( builtins . groupBy lib . id list ) ;
6
8
in
7
9
{
8
10
options . facter . boot . enable = lib . mkEnableOption "Enable the Facter Boot module" // {
12
14
config =
13
15
with lib ;
14
16
mkIf cfg . enable {
15
- boot . initrd . availableKernelModules = filter ( dm : dm != null ) (
16
- unique (
17
- map
18
- (
19
- {
20
- driver_module ? null ,
21
- ...
22
- } :
23
- driver_module
24
- )
25
- ( flatten [
26
- # Needed if we want to use the keyboard when things go wrong in the initrd.
27
- ( report . hardware . usb_controller or [ ] )
28
- # A disk might be attached.
29
- ( report . hardware . firewire_controller or [ ] )
30
- # definitely important
31
- ( report . hardware . disk or [ ] )
32
- ( report . hardware . storage_controller or [ ] )
33
- ] )
17
+ boot . initrd . availableKernelModules = stringSet (
18
+ collectDriver (
19
+ # Needed if we want to use the keyboard when things go wrong in the initrd.
20
+ ( report . hardware . usb_controller or [ ] )
21
+ # A disk might be attached.
22
+ ++ ( report . hardware . firewire_controller or [ ] )
23
+ # definitely important
24
+ ++ ( report . hardware . disk or [ ] )
25
+ ++ ( report . hardware . storage_controller or [ ] )
34
26
)
35
27
) ;
36
28
} ;
You can’t perform that action at this time.
0 commit comments