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.
19 lines
573 B
Nix
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" ];
|
|
};
|
|
}
|