Skip to content

Commit

Permalink
Merge pull request #49 from britter/amd-graphics
Browse files Browse the repository at this point in the history
graphics: Introduce amd module
  • Loading branch information
Mic92 authored Nov 4, 2024
2 parents 8840660 + a1d95f4 commit 14bf524
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/nixos/facter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
./disk.nix
./keyboard.nix
./firmware.nix
./graphics.nix
./graphics
./networking
./system.nix
./virtualisation.nix
Expand Down
17 changes: 17 additions & 0 deletions modules/nixos/graphics/amd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ 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 = builtins.elem "amdgpu" (
facterLib.collectDrivers (config.facter.report.hardware.graphics_card or [ ])
);
};
};
config = lib.mkIf cfg.enable {
services.xserver.videoDrivers = [ "amdgpu" ];
};
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{ lib, config, ... }:
let
facterLib = import ../../lib/lib.nix lib;
facterLib = import ../../../lib/lib.nix lib;
cfg = config.facter.detected.graphics;
in
{
imports = [
./amd.nix
];
options.facter.detected = {
graphics.enable = lib.mkEnableOption "Enable the Graphics module" // {
default = builtins.length (config.facter.report.hardware.monitor or [ ]) > 0;
Expand Down

0 comments on commit 14bf524

Please sign in to comment.