Skip to content

Commit

Permalink
graphics (amd): Use facter lib to access drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
britter committed Oct 27, 2024
1 parent d2f40f8 commit a1d95f4
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions modules/nixos/graphics/amd.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{ lib, config, ... }:
let
facterLib = import ../../../lib/lib.nix lib;
cfg = config.facter.detected.graphics.amd;
in
{
options.facter.detected.graphics = {
amd.enable = lib.mkEnableOption "Enable the AMD Graphics module" // {
default =
let
graphicsDrivers = builtins.map (graphics_card: graphics_card.driver) (
config.facter.report.hardware.graphics_card or [ ]
);
in
builtins.elem "amdgpu" graphicsDrivers;
default = builtins.elem "amdgpu" (
facterLib.collectDrivers (config.facter.report.hardware.graphics_card or [ ])
);
};
};
config = lib.mkIf cfg.enable {
Expand Down

0 comments on commit a1d95f4

Please sign in to comment.