nixos GDM: fix #19896

- As noted on github, GDM needs different parameters for X.
- Making xserverArgs a true list instead of concat-string helps to
  filter it and it feels more correct anyway.
- Tested: gdm+gnome, lightdm+gnome.  There seems to be no logout option
  in gnome, and gdm doesn't offer other sessions, but maybe these are normal.
This commit is contained in:
Vladimír Čunát 2016-12-04 14:48:47 +01:00
parent fd6dbd9d17
commit a1ae627362
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
6 changed files with 10 additions and 6 deletions

View file

@ -187,7 +187,6 @@ in
default = []; default = [];
example = [ "-ac" "-logverbose" "-verbose" "-nolisten tcp" ]; example = [ "-ac" "-logverbose" "-verbose" "-nolisten tcp" ];
description = "List of arguments for the X server."; description = "List of arguments for the X server.";
apply = toString;
}; };
sessionCommands = mkOption { sessionCommands = mkOption {

View file

@ -92,10 +92,15 @@ in
users.extraGroups.gdm.gid = config.ids.gids.gdm; users.extraGroups.gdm.gid = config.ids.gids.gdm;
# GDM needs different xserverArgs, presumable because using wayland by default.
services.xserver.tty = null;
services.xserver.display = null;
services.xserver.displayManager.job = services.xserver.displayManager.job =
{ {
environment = { environment = {
GDM_X_SERVER_EXTRA_ARGS = "${cfg.xserverArgs}"; GDM_X_SERVER_EXTRA_ARGS = toString
(filter (arg: arg != "-terminate") cfg.xserverArgs);
GDM_SESSIONS_DIR = "${cfg.session.desktops}"; GDM_SESSIONS_DIR = "${cfg.session.desktops}";
# Find the mouse # Find the mouse
XCURSOR_PATH = "~/.icons:${config.system.path}/share/icons"; XCURSOR_PATH = "~/.icons:${config.system.path}/share/icons";

View file

@ -25,7 +25,7 @@ let
FailsafeClient=${pkgs.xterm}/bin/xterm FailsafeClient=${pkgs.xterm}/bin/xterm
[X-:*-Core] [X-:*-Core]
ServerCmd=${dmcfg.xserverBin} ${dmcfg.xserverArgs} ServerCmd=${dmcfg.xserverBin} ${toString dmcfg.xserverArgs}
# KDM calls `rm' somewhere to clean up some temporary directory. # KDM calls `rm' somewhere to clean up some temporary directory.
SystemPath=${pkgs.coreutils}/bin SystemPath=${pkgs.coreutils}/bin
# The default timeout (15) is too short in a heavily loaded boot process. # The default timeout (15) is too short in a heavily loaded boot process.

View file

@ -23,7 +23,7 @@ let
else additionalArgs="-logfile /var/log/X.$display.log" else additionalArgs="-logfile /var/log/X.$display.log"
fi fi
exec ${dmcfg.xserverBin} ${dmcfg.xserverArgs} $additionalArgs "$@" exec ${dmcfg.xserverBin} ${toString dmcfg.xserverArgs} $additionalArgs "$@"
''; '';
usersConf = writeText "users.conf" usersConf = writeText "users.conf"

View file

@ -14,7 +14,7 @@ let
xserverWrapper = pkgs.writeScript "xserver-wrapper" '' xserverWrapper = pkgs.writeScript "xserver-wrapper" ''
#!/bin/sh #!/bin/sh
${concatMapStrings (n: "export ${n}=\"${getAttr n xEnv}\"\n") (attrNames xEnv)} ${concatMapStrings (n: "export ${n}=\"${getAttr n xEnv}\"\n") (attrNames xEnv)}
exec systemd-cat ${dmcfg.xserverBin} ${dmcfg.xserverArgs} "$@" exec systemd-cat ${dmcfg.xserverBin} ${toString dmcfg.xserverArgs} "$@"
''; '';
Xsetup = pkgs.writeScript "Xsetup" '' Xsetup = pkgs.writeScript "Xsetup" ''

View file

@ -12,7 +12,7 @@ let
'' ''
xauth_path ${dmcfg.xauthBin} xauth_path ${dmcfg.xauthBin}
default_xserver ${dmcfg.xserverBin} default_xserver ${dmcfg.xserverBin}
xserver_arguments ${dmcfg.xserverArgs} xserver_arguments ${toString dmcfg.xserverArgs}
sessiondir ${dmcfg.session.desktops} sessiondir ${dmcfg.session.desktops}
login_cmd exec ${pkgs.stdenv.shell} ${dmcfg.session.script} "%session" login_cmd exec ${pkgs.stdenv.shell} ${dmcfg.session.script} "%session"
halt_cmd ${config.systemd.package}/sbin/shutdown -h now halt_cmd ${config.systemd.package}/sbin/shutdown -h now