fix(gpu): add checks for session-specific options
This commit is contained in:
parent
7e4d1afb5c
commit
f2de94be1b
|
@ -46,11 +46,14 @@ in {
|
||||||
optional (cfg.type == "nvidia") vulkan-validation-layers;
|
optional (cfg.type == "nvidia") vulkan-validation-layers;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.videoDrivers =
|
services.xserver = mkIf cfg.session {
|
||||||
optional nvidia "nvidia" ++
|
videoDrivers =
|
||||||
optional (cfg.type == "amdgpu") "amdgpu";
|
optional nvidia "nvidia" ++
|
||||||
# inhibits default display manager
|
optional (cfg.type == "amdgpu") "amdgpu";
|
||||||
services.xserver.displayManager.startx.enable = mkDefault true;
|
# inhibits default display manager
|
||||||
|
|
||||||
|
displayManager.startx.enable = mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
hardware.nvidia = mkIf nvidia {
|
hardware.nvidia = mkIf nvidia {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.global.gpu;
|
cfg = config.global.gpu;
|
||||||
in mkIf (cfg.enable && cfg.session) {
|
gui = with cfg; enable && session;
|
||||||
|
in mkIf gui {
|
||||||
programs.regreet = {
|
programs.regreet = {
|
||||||
enable = mkDefault true;
|
enable = mkDefault true;
|
||||||
cageArgs = [ "-s" "-d" "-m" "last" ];
|
cageArgs = [ "-s" "-d" "-m" "last" ];
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.global.gpu;
|
cfg = config.global.gpu;
|
||||||
in mkIf cfg.enable {
|
gui = with cfg; enable && session;
|
||||||
|
in mkIf gui {
|
||||||
boot = {
|
boot = {
|
||||||
loader.timeout = mkDefault 0;
|
loader.timeout = mkDefault 0;
|
||||||
consoleLogLevel = 0;
|
consoleLogLevel = 0;
|
||||||
|
|
Loading…
Reference in a new issue