2009-04-13 10:55:41 +00:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
2009-08-16 14:49:14 +00:00
|
|
|
with pkgs.lib;
|
2009-04-13 10:55:41 +00:00
|
|
|
|
|
|
|
let
|
2009-08-16 14:49:14 +00:00
|
|
|
|
|
|
|
dmcfg = config.services.xserver.displayManager;
|
2009-04-13 10:55:41 +00:00
|
|
|
cfg = dmcfg.kdm;
|
|
|
|
|
|
|
|
inherit (pkgs.kde42) kdebase_workspace;
|
|
|
|
|
2009-08-16 14:49:14 +00:00
|
|
|
kdmrc = pkgs.stdenv.mkDerivation {
|
2009-04-13 10:55:41 +00:00
|
|
|
name = "kdmrc";
|
2009-05-28 14:37:30 +00:00
|
|
|
# -e "s|Session=${kdebase_workspace}/share/config/kdm/Xsession|Session=${dmcfg.session.script}|" \
|
2009-04-13 10:55:41 +00:00
|
|
|
buildCommand = ''
|
|
|
|
cp ${kdebase_workspace}/share/config/kdm/kdmrc .
|
|
|
|
sed -i -e "s|#HaltCmd=|HaltCmd=${pkgs.upstart}/sbin/halt|" \
|
|
|
|
-e "s|#RebootCmd=|RebootCmd=${pkgs.upstart}/sbin/reboot|" \
|
|
|
|
-e "s|#Xrdb=|Xrdb=${pkgs.xlibs.xrdb}/bin/xrdb|" \
|
|
|
|
-e "s|#HiddenUsers=root|HiddenUsers=root,nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10|" \
|
|
|
|
-e "s|ServerCmd=/FOO/bin/X|ServerCmd=${dmcfg.xserverBin} ${dmcfg.xserverArgs}|" \
|
2009-04-13 10:57:36 +00:00
|
|
|
-e "s|^SessionsDirs=.*$|SessionsDirs=${dmcfg.session.desktops}|" \
|
2009-04-13 10:55:41 +00:00
|
|
|
-e "s|#FailsafeClient=|FailsafeClient=${pkgs.xterm}/bin/xterm|" \
|
|
|
|
-e "s|#PluginsLogin=sign|PluginsLogin=${kdebase_workspace}/lib/kde4/kgreet_classic.so|" \
|
|
|
|
kdmrc
|
|
|
|
ensureDir $out
|
|
|
|
cp kdmrc $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-08-16 14:49:14 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
2009-04-13 10:55:41 +00:00
|
|
|
|
2009-08-16 14:49:14 +00:00
|
|
|
services.xserver.displayManager.kdm = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the KDE display manager.
|
|
|
|
'';
|
2009-04-13 10:55:41 +00:00
|
|
|
};
|
|
|
|
};
|
2009-08-16 14:49:14 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
services.xserver.displayManager.job =
|
|
|
|
{ beforeScript = "";
|
|
|
|
env = "";
|
|
|
|
execCmd = "${kdebase_workspace}/bin/kdm -config ${kdmrc}/kdmrc";
|
|
|
|
};
|
|
|
|
|
2009-09-02 17:00:25 +00:00
|
|
|
security.pam.services = [ { name = "kde"; localLogin = true; } ];
|
2009-08-16 14:49:14 +00:00
|
|
|
|
2009-04-13 10:55:41 +00:00
|
|
|
};
|
2009-08-16 14:49:14 +00:00
|
|
|
|
2009-04-13 10:55:41 +00:00
|
|
|
}
|