We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e32635b commit d2f40f8Copy full SHA for d2f40f8
modules/nixos/graphics/amd.nix
@@ -1,14 +1,20 @@
1
-{lib, config,...}:
+{ lib, config, ... }:
2
let
3
cfg = config.facter.detected.graphics.amd;
4
in
5
{
6
options.facter.detected.graphics = {
7
amd.enable = lib.mkEnableOption "Enable the AMD Graphics module" // {
8
- default = builtins.elem "amdgpu" (builtins.map (graphics_card: graphics_card.driver) config.facter.report.hardware.graphics_card);
+ 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;
15
};
16
17
config = lib.mkIf cfg.enable {
- services.xserver.videoDrivers = ["amdgpu"];
18
+ services.xserver.videoDrivers = [ "amdgpu" ];
19
20
}
0 commit comments