slim: Only enable if the X server is enabled

http://hydra.nixos.org/build/6494972

Disabling slim revealed that services.xserver.displayManager.job had
an incorrect type, so fixed that as well.

+31 -32
+25 -29
nixos/modules/services/x11/display-managers/default.nix
··· 239 239 }; 240 240 }; 241 241 242 - job = mkOption { 243 - default = {}; 244 - type = types.uniq types.optionSet; 245 - description = "This option defines how to start the display manager."; 242 + job = { 246 243 247 - options = { 244 + preStart = mkOption { 245 + type = types.lines; 246 + default = ""; 247 + example = "rm -f /var/log/my-display-manager.log"; 248 + description = "Script executed before the display manager is started."; 249 + }; 248 250 249 - preStart = mkOption { 250 - default = ""; 251 - example = "rm -f /var/log/my-display-manager.log"; 252 - description = "Script executed before the display manager is started."; 253 - }; 254 - 255 - execCmd = mkOption { 256 - example = "${pkgs.slim}/bin/slim"; 257 - description = "Command to start the display manager."; 258 - }; 259 - 260 - environment = mkOption { 261 - default = {}; 262 - example = { SLIM_CFGFILE = /etc/slim.conf; }; 263 - description = "Additional environment variables needed by the display manager."; 264 - }; 251 + execCmd = mkOption { 252 + type = types.uniq types.string; 253 + example = "${pkgs.slim}/bin/slim"; 254 + description = "Command to start the display manager."; 255 + }; 265 256 266 - logsXsession = mkOption { 267 - default = false; 268 - description = '' 269 - Whether the display manager redirects the 270 - output of the session script to 271 - <filename>~/.xsession-errors</filename>. 272 - ''; 273 - }; 257 + environment = mkOption { 258 + default = {}; 259 + example = { SLIM_CFGFILE = /etc/slim.conf; }; 260 + description = "Additional environment variables needed by the display manager."; 261 + }; 274 262 263 + logsXsession = mkOption { 264 + type = types.bool; 265 + default = false; 266 + description = '' 267 + Whether the display manager redirects the 268 + output of the session script to 269 + <filename>~/.xsession-errors</filename>. 270 + ''; 275 271 }; 276 272 277 273 };
+1 -1
nixos/modules/services/x11/display-managers/kdm.nix
··· 128 128 services.xserver.displayManager.slim.enable = false; 129 129 130 130 services.xserver.displayManager.job = 131 - { execCmd = 131 + { execCmd = mkFixStrictness 132 132 '' 133 133 mkdir -m 0755 -p /var/lib/kdm 134 134 chown kdm /var/lib/kdm
+4 -1
nixos/modules/services/x11/display-managers/lightdm.nix
··· 89 89 }; 90 90 91 91 config = mkIf cfg.enable { 92 + 93 + services.xserver.displayManager.slim.enable = false; 94 + 92 95 services.xserver.displayManager.job = { 93 96 logsXsession = true; 94 97 95 98 # lightdm relaunches itself via just `lightdm`, so needs to be on the PATH 96 - execCmd = '' 99 + execCmd = mkFixStrictness '' 97 100 export PATH=${lightdm}/sbin:$PATH 98 101 ${lightdm}/sbin/lightdm --log-dir=/var/log --run-dir=/run --config=${lightdmConf} 99 102 '';
+1 -1
nixos/modules/services/x11/display-managers/slim.nix
··· 45 45 services.xserver.displayManager.slim = { 46 46 47 47 enable = mkOption { 48 - default = true; 48 + default = config.services.xserver.enable; 49 49 description = '' 50 50 Whether to enable SLiM as the display manager. 51 51 '';