Loading nixos/modules/hardware/facter/default.nix +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ imports = [ ./disk.nix ./firmware.nix ./graphics ./keyboard.nix ./networking ./system.nix Loading nixos/modules/hardware/facter/graphics/amd.nix 0 → 100644 +18 −0 Original line number Diff line number Diff line { 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 cfg.enable { services.xserver.videoDrivers = [ "modesetting" ]; }; } nixos/modules/hardware/facter/graphics/default.nix 0 → 100644 +42 −0 Original line number Diff line number Diff line { lib, config, ... }: let facterLib = import ../lib.nix lib; cfg = config.hardware.facter.detected.graphics; in { imports = [ ./amd.nix ]; options.hardware.facter.detected = { graphics.enable = lib.mkEnableOption "Enable the Graphics module" // { default = builtins.length (config.hardware.facter.report.hardware.monitor or [ ]) > 0; defaultText = "hardware dependent"; }; boot.graphics.kernelModules = lib.mkOption { type = lib.types.listOf lib.types.str; # We currently don't auto import nouveau, in case the user might want to use the proprietary nvidia driver, # We might want to change this in future, if we have a better idea, how to handle this. default = lib.remove "nouveau" ( lib.uniqueStrings ( facterLib.collectDrivers (config.hardware.facter.report.hardware.graphics_card or [ ]) ) ); defaultText = "hardware dependent"; description = '' List of kernel modules to load at boot for the graphics card. ''; }; }; config = lib.mkIf cfg.enable ( { boot.initrd.kernelModules = config.hardware.facter.detected.boot.graphics.kernelModules; } // ( if lib.versionOlder lib.version "24.11pre" then { hardware.opengl.enable = lib.mkDefault true; } else { hardware.graphics.enable = lib.mkDefault true; } ) ); } Loading
nixos/modules/hardware/facter/default.nix +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ imports = [ ./disk.nix ./firmware.nix ./graphics ./keyboard.nix ./networking ./system.nix Loading
nixos/modules/hardware/facter/graphics/amd.nix 0 → 100644 +18 −0 Original line number Diff line number Diff line { 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 cfg.enable { services.xserver.videoDrivers = [ "modesetting" ]; }; }
nixos/modules/hardware/facter/graphics/default.nix 0 → 100644 +42 −0 Original line number Diff line number Diff line { lib, config, ... }: let facterLib = import ../lib.nix lib; cfg = config.hardware.facter.detected.graphics; in { imports = [ ./amd.nix ]; options.hardware.facter.detected = { graphics.enable = lib.mkEnableOption "Enable the Graphics module" // { default = builtins.length (config.hardware.facter.report.hardware.monitor or [ ]) > 0; defaultText = "hardware dependent"; }; boot.graphics.kernelModules = lib.mkOption { type = lib.types.listOf lib.types.str; # We currently don't auto import nouveau, in case the user might want to use the proprietary nvidia driver, # We might want to change this in future, if we have a better idea, how to handle this. default = lib.remove "nouveau" ( lib.uniqueStrings ( facterLib.collectDrivers (config.hardware.facter.report.hardware.graphics_card or [ ]) ) ); defaultText = "hardware dependent"; description = '' List of kernel modules to load at boot for the graphics card. ''; }; }; config = lib.mkIf cfg.enable ( { boot.initrd.kernelModules = config.hardware.facter.detected.boot.graphics.kernelModules; } // ( if lib.versionOlder lib.version "24.11pre" then { hardware.opengl.enable = lib.mkDefault true; } else { hardware.graphics.enable = lib.mkDefault true; } ) ); }