2009-04-13 12:55:41 +02:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
with pkgs.lib;
|
2009-04-13 12:55:41 +02:00
|
|
|
|
|
|
|
let
|
2009-08-16 16:49:14 +02:00
|
|
|
|
|
|
|
dmcfg = config.services.xserver.displayManager;
|
2009-04-13 12:55:41 +02:00
|
|
|
cfg = dmcfg.kdm;
|
|
|
|
|
2009-09-13 13:09:58 +02:00
|
|
|
inherit (pkgs.kde4) kdebase_workspace;
|
2009-04-13 12:55:41 +02:00
|
|
|
|
2009-09-02 20:35:23 +02:00
|
|
|
defaultConfig =
|
|
|
|
''
|
|
|
|
[Shutdown]
|
|
|
|
HaltCmd=${pkgs.upstart}/sbin/halt
|
|
|
|
RebootCmd=${pkgs.upstart}/sbin/reboot
|
2009-09-27 23:51:47 +02:00
|
|
|
${optionalString (config.system.boot.loader.id == "grub") ''
|
2009-09-13 17:03:07 +02:00
|
|
|
BootManager=Grub
|
|
|
|
''}
|
2009-09-02 20:35:23 +02:00
|
|
|
|
|
|
|
[X-*-Core]
|
|
|
|
Xrdb=${pkgs.xlibs.xrdb}/bin/xrdb
|
|
|
|
SessionsDirs=${dmcfg.session.desktops}
|
2009-09-13 15:34:52 +02:00
|
|
|
Session=${dmcfg.session.script}
|
2009-09-02 20:35:23 +02:00
|
|
|
FailsafeClient=${pkgs.xterm}/bin/xterm
|
|
|
|
|
|
|
|
[X-:*-Core]
|
|
|
|
ServerCmd=${dmcfg.xserverBin} ${dmcfg.xserverArgs}
|
2009-09-10 17:58:39 +02:00
|
|
|
# Needed to prevent the X server from dying on logout and not coming back:
|
|
|
|
TerminateServer=true
|
2009-09-02 20:35:23 +02:00
|
|
|
|
|
|
|
[X-*-Greeter]
|
|
|
|
HiddenUsers=root,nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10
|
|
|
|
PluginsLogin=${kdebase_workspace}/lib/kde4/kgreet_classic.so
|
|
|
|
'';
|
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
kdmrc = pkgs.stdenv.mkDerivation {
|
2009-04-13 12:55:41 +02:00
|
|
|
name = "kdmrc";
|
2009-09-02 20:35:23 +02:00
|
|
|
config = defaultConfig + cfg.extraConfig;
|
|
|
|
buildCommand =
|
|
|
|
''
|
|
|
|
echo "$config" > $out
|
|
|
|
cat ${kdebase_workspace}/share/config/kdm/kdmrc >> $out
|
|
|
|
'';
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
2009-04-13 12:55:41 +02:00
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
services.xserver.displayManager.kdm = {
|
2009-09-02 20:35:23 +02:00
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the KDE display manager.
|
|
|
|
'';
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
2009-09-02 20:35:23 +02:00
|
|
|
|
|
|
|
extraConfig = mkOption {
|
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
Options appended to <filename>kdmrc</filename>, the
|
|
|
|
configuration file of KDM.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
2009-08-16 16:49:14 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
services.xserver.displayManager.job =
|
2009-09-13 17:03:07 +02:00
|
|
|
{ execCmd = "PATH=${pkgs.grub}/sbin:$PATH ${kdebase_workspace}/bin/kdm -config ${kdmrc}";
|
2009-09-13 15:34:52 +02:00
|
|
|
logsXsession = true;
|
2009-08-16 16:49:14 +02:00
|
|
|
};
|
|
|
|
|
2009-09-13 16:05:21 +02:00
|
|
|
security.pam.services = [ { name = "kde"; } ];
|
2009-08-16 16:49:14 +02:00
|
|
|
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
2009-08-16 16:49:14 +02:00
|
|
|
|
2009-04-13 12:55:41 +02:00
|
|
|
}
|