File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 23
23
vendor_name == name
24
24
) cpus ;
25
25
26
+ collectDrivers = list : lib . foldl' ( lst : value : lst ++ value . driver_modules or [ ] ) [ ] list ;
27
+ stringSet = list : builtins . attrNames ( builtins . groupBy lib . id list ) ;
26
28
in
27
29
{
28
- inherit hasCpu ;
30
+ inherit hasCpu collectDrivers stringSet ;
29
31
hasAmdCpu = hasCpu "AuthenticAMD" ;
30
32
hasIntelCpu = hasCpu "GenuineIntel" ;
31
33
}
Original file line number Diff line number Diff line change 1
1
{ lib , config , ... } :
2
2
let
3
+ facterLib = import ../../lib/lib.nix lib ;
3
4
4
5
cfg = config . facter . boot ;
5
6
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 ) ;
8
7
in
9
8
{
10
9
options . facter . boot . enable = lib . mkEnableOption "Enable the Facter Boot module" // {
14
13
config =
15
14
with lib ;
16
15
mkIf cfg . enable {
17
- boot . initrd . availableKernelModules = stringSet (
18
- collectDriver (
16
+ boot . initrd . availableKernelModules = facterLib . stringSet (
17
+ facterLib . collectDrivers (
19
18
# Needed if we want to use the keyboard when things go wrong in the initrd.
20
19
( report . hardware . usb_controller or [ ] )
21
20
# A disk might be attached.
Original file line number Diff line number Diff line change 1
1
{ lib , config , ... } :
2
+ let
3
+ facterLib = import ../../lib/lib.nix lib ;
4
+ in
2
5
{
3
6
options . facter . graphics . enable = lib . mkEnableOption "Enable the Graphics module" // {
4
- default = builtins . length ( config . facter . report . hardware . monitor or [ ] ) > 0 ;
7
+ default = builtins . length ( config . facter . report . hardware . monitor or [ ] ) > 0 ;
5
8
} ;
6
9
7
- config . hardware . graphics . enable = lib . mkIf config . facter . graphics . enable ( lib . mkDefault true ) ;
10
+ config = lib . mkIf config . facter . graphics . enable {
11
+ hardware . graphics . enable = lib . mkDefault true ;
12
+ boot . initrd . kernelModules = facterLib . stringSet (
13
+ facterLib . collectDrivers ( config . facter . report . hardware . graphics_card or [ ] )
14
+ ) ;
15
+ } ;
8
16
}
You can’t perform that action at this time.
0 commit comments