summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/x11/display-managers
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-09-27 18:07:43 -0400
committerworldofpeace <worldofpeace@protonmail.ch>2019-11-19 15:34:39 -0500
commit84e6784aaed60fe10d322fa50ad9a44339a9e9e0 (patch)
tree88687d4f4bcfc678ec76a1c9c05589c210f37946 /nixos/modules/services/x11/display-managers
parent7b71fb57d494d53eea186fe1383c4475d342b02d (diff)
nixos/gdm: add nvidiaWayland option
Diffstat (limited to 'nixos/modules/services/x11/display-managers')
-rw-r--r--nixos/modules/services/x11/display-managers/gdm.nix23
1 files changed, 22 insertions, 1 deletions
diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix
index e5990aec4b9c..4830ec0030b2 100644
--- a/nixos/modules/services/x11/display-managers/gdm.nix
+++ b/nixos/modules/services/x11/display-managers/gdm.nix
@@ -88,11 +88,21 @@ in
wayland = mkOption {
default = true;
description = ''
- Allow GDM run on Wayland instead of Xserver
+ Allow GDM to run on Wayland instead of Xserver.
+ Note to enable Wayland with Nvidia you need to
+ enable the <option>nvidiaWayland</option>.
'';
type = types.bool;
};
+ nvidiaWayland = mkOption {
+ default = false;
+ description = ''
+ Whether to allow wayland to be used with the proprietary
+ NVidia graphics driver.
+ '';
+ };
+
autoSuspend = mkOption {
default = true;
description = ''
@@ -197,6 +207,17 @@ in
services.dbus.packages = [ gdm ];
+ # We duplicate upstream's udev rules manually to make wayland with nvidia configurable
+ services.udev.extraRules = ''
+ # disable Wayland on Cirrus chipsets
+ ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", RUN+="${gdm}/libexec/gdm-disable-wayland"
+ # disable Wayland on Hi1710 chipsets
+ ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="${gdm}/libexec/gdm-disable-wayland"
+ ${optionalString (!cfg.gdm.nvidiaWayland) ''
+ DRIVER=="nvidia", RUN+="${gdm}/libexec/gdm-disable-wayland"
+ ''}
+ '';
+
systemd.user.services.dbus.wantedBy = [ "default.target" ];
programs.dconf.profiles.gdm =