Skip to content

Commit a1d95f4

Browse files
committed
graphics (amd): Use facter lib to access drivers
1 parent d2f40f8 commit a1d95f4

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

modules/nixos/graphics/amd.nix

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
{ lib, config, ... }:
22
let
3+
facterLib = import ../../../lib/lib.nix lib;
34
cfg = config.facter.detected.graphics.amd;
45
in
56
{
67
options.facter.detected.graphics = {
78
amd.enable = lib.mkEnableOption "Enable the AMD Graphics module" // {
8-
default =
9-
let
10-
graphicsDrivers = builtins.map (graphics_card: graphics_card.driver) (
11-
config.facter.report.hardware.graphics_card or [ ]
12-
);
13-
in
14-
builtins.elem "amdgpu" graphicsDrivers;
9+
default = builtins.elem "amdgpu" (
10+
facterLib.collectDrivers (config.facter.report.hardware.graphics_card or [ ])
11+
);
1512
};
1613
};
1714
config = lib.mkIf cfg.enable {

0 commit comments

Comments
 (0)