From 4ef82339c9a32548d2432ca71e8aac87abe79777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rostislav=20Bene=C5=A1?= Date: Sun, 7 May 2017 22:27:02 +0200 Subject: [PATCH] nixos/gdm,nvidia: new options to enable GDM on Wayland and disabling it for nvidia drivers. --- nixos/modules/hardware/video/nvidia.nix | 6 ++++++ nixos/modules/services/x11/display-managers/gdm.nix | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index 2bad50d65e7a..52f1773e9c45 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -40,6 +40,12 @@ in { config = mkIf enabled { + assertions = [ + { + assertion = services.xserver.displayManager.gdm.wayland; + message = "NVidia drivers don't support wayland"; + } + ]; services.xserver.drivers = singleton { name = "nvidia"; modules = [ nvidia_x11.bin ]; libPath = [ nvidia_x11 ]; }; diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix index b0a3ff1bb753..e68bc816aad2 100644 --- a/nixos/modules/services/x11/display-managers/gdm.nix +++ b/nixos/modules/services/x11/display-managers/gdm.nix @@ -64,6 +64,14 @@ in }; }; + wayland = mkOption { + default = true; + description = '' + Allow GDM run on Wayland instead of Xserver + ''; + type = types.bool; + }; + }; }; @@ -139,6 +147,7 @@ in # presented and there's a little delay. environment.etc."gdm/custom.conf".text = '' [daemon] + WaylandEnable=${if cfg.gdm.wayland then "true" else "false"} ${optionalString cfg.gdm.autoLogin.enable ( if cfg.gdm.autoLogin.delay > 0 then '' TimedLoginEnable=true