nixos/gdm: add nvidiaWayland option
This commit is contained in:
parent
7b71fb57d4
commit
84e6784aae
|
@ -88,11 +88,21 @@ in
|
||||||
wayland = mkOption {
|
wayland = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
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;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nvidiaWayland = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Whether to allow wayland to be used with the proprietary
|
||||||
|
NVidia graphics driver.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
autoSuspend = mkOption {
|
autoSuspend = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -197,6 +207,17 @@ in
|
||||||
|
|
||||||
services.dbus.packages = [ gdm ];
|
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" ];
|
systemd.user.services.dbus.wantedBy = [ "default.target" ];
|
||||||
|
|
||||||
programs.dconf.profiles.gdm =
|
programs.dconf.profiles.gdm =
|
||||||
|
|
Loading…
Reference in a new issue