Files
andre4ik3 5dd1dff815 nixos/facter: add enable option
The option defaults to `report != { }` instead of `reportPath != null`,
because since the report may be set externally using `report`, guarding
for `reportPath != null` breaks setups that set it externally, since
none of the modules take effect any longer.
2026-03-11 09:07:52 +00:00

19 lines
573 B
Nix

{ lib, config, ... }:
let
facterLib = import ../lib.nix lib;
cfg = config.hardware.facter.detected.graphics.amd;
in
{
options.hardware.facter.detected.graphics = {
amd.enable = lib.mkEnableOption "Enable the AMD Graphics module" // {
default = builtins.elem "amdgpu" (
facterLib.collectDrivers (config.hardware.facter.report.hardware.graphics_card or [ ])
);
defaultText = "hardware dependent";
};
};
config = lib.mkIf (config.hardware.facter.enable && cfg.enable) {
services.xserver.videoDrivers = [ "modesetting" ];
};
}