commit
8237fa43d3
@ -40,6 +40,12 @@ in
|
|||||||
{
|
{
|
||||||
|
|
||||||
config = mkIf enabled {
|
config = mkIf enabled {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = services.xserver.displayManager.gdm.wayland;
|
||||||
|
message = "NVidia drivers don't support wayland";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
services.xserver.drivers = singleton
|
services.xserver.drivers = singleton
|
||||||
{ name = "nvidia"; modules = [ nvidia_x11.bin ]; libPath = [ nvidia_x11 ]; };
|
{ name = "nvidia"; modules = [ nvidia_x11.bin ]; libPath = [ nvidia_x11 ]; };
|
||||||
@ -62,11 +68,16 @@ in
|
|||||||
boot.extraModulePackages = [ nvidia_x11.bin ];
|
boot.extraModulePackages = [ nvidia_x11.bin ];
|
||||||
|
|
||||||
# nvidia-uvm is required by CUDA applications.
|
# nvidia-uvm is required by CUDA applications.
|
||||||
boot.kernelModules = [ "nvidia-uvm" ];
|
boot.kernelModules = [ "nvidia-uvm" ] ++
|
||||||
|
lib.optionals config.services.xserver.enable [ "nvidia" "nvidia_modeset" "nvidia_drm" ];
|
||||||
|
|
||||||
|
|
||||||
# Create /dev/nvidia-uvm when the nvidia-uvm module is loaded.
|
# Create /dev/nvidia-uvm when the nvidia-uvm module is loaded.
|
||||||
services.udev.extraRules =
|
services.udev.extraRules =
|
||||||
''
|
''
|
||||||
|
KERNEL=="nvidia", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidiactl c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) 255'"
|
||||||
|
KERNEL=="nvidia_modeset", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia-modeset c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) 254'"
|
||||||
|
KERNEL=="card*", SUBSYSTEM=="drm", DRIVERS=="nvidia", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia%n c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) %n'"
|
||||||
KERNEL=="nvidia_uvm", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 0'"
|
KERNEL=="nvidia_uvm", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 0'"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -64,6 +64,14 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wayland = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Allow GDM run on Wayland instead of Xserver
|
||||||
|
'';
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -94,6 +102,7 @@ in
|
|||||||
# GDM needs different xserverArgs, presumable because using wayland by default.
|
# GDM needs different xserverArgs, presumable because using wayland by default.
|
||||||
services.xserver.tty = null;
|
services.xserver.tty = null;
|
||||||
services.xserver.display = null;
|
services.xserver.display = null;
|
||||||
|
services.xserver.verbose = null;
|
||||||
|
|
||||||
services.xserver.displayManager.job =
|
services.xserver.displayManager.job =
|
||||||
{
|
{
|
||||||
@ -139,6 +148,7 @@ in
|
|||||||
# presented and there's a little delay.
|
# presented and there's a little delay.
|
||||||
environment.etc."gdm/custom.conf".text = ''
|
environment.etc."gdm/custom.conf".text = ''
|
||||||
[daemon]
|
[daemon]
|
||||||
|
WaylandEnable=${if cfg.gdm.wayland then "true" else "false"}
|
||||||
${optionalString cfg.gdm.autoLogin.enable (
|
${optionalString cfg.gdm.autoLogin.enable (
|
||||||
if cfg.gdm.autoLogin.delay > 0 then ''
|
if cfg.gdm.autoLogin.delay > 0 then ''
|
||||||
TimedLoginEnable=true
|
TimedLoginEnable=true
|
||||||
|
@ -480,6 +480,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
verbose = mkOption {
|
||||||
|
type = types.nullOr types.int;
|
||||||
|
default = 3;
|
||||||
|
example = 7;
|
||||||
|
description = ''
|
||||||
|
Controls verbosity of X logging.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
useGlamor = mkOption {
|
useGlamor = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@ -631,10 +640,11 @@ in
|
|||||||
[ "-config ${configFile}"
|
[ "-config ${configFile}"
|
||||||
"-xkbdir" "${cfg.xkbDir}"
|
"-xkbdir" "${cfg.xkbDir}"
|
||||||
# Log at the default verbosity level to stderr rather than /var/log/X.*.log.
|
# Log at the default verbosity level to stderr rather than /var/log/X.*.log.
|
||||||
"-verbose" "3" "-logfile" "/dev/null"
|
"-logfile" "/dev/null"
|
||||||
] ++ optional (cfg.display != null) ":${toString cfg.display}"
|
] ++ optional (cfg.display != null) ":${toString cfg.display}"
|
||||||
++ optional (cfg.tty != null) "vt${toString cfg.tty}"
|
++ optional (cfg.tty != null) "vt${toString cfg.tty}"
|
||||||
++ optional (cfg.dpi != null) "-dpi ${toString cfg.dpi}"
|
++ optional (cfg.dpi != null) "-dpi ${toString cfg.dpi}"
|
||||||
|
++ optional (cfg.verbose != null) "-verbose ${toString cfg.verbose}"
|
||||||
++ optional (!cfg.enableTCP) "-nolisten tcp"
|
++ optional (!cfg.enableTCP) "-nolisten tcp"
|
||||||
++ optional (cfg.autoRepeatDelay != null) "-ardelay ${toString cfg.autoRepeatDelay}"
|
++ optional (cfg.autoRepeatDelay != null) "-ardelay ${toString cfg.autoRepeatDelay}"
|
||||||
++ optional (cfg.autoRepeatInterval != null) "-arinterval ${toString cfg.autoRepeatInterval}"
|
++ optional (cfg.autoRepeatInterval != null) "-arinterval ${toString cfg.autoRepeatInterval}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user