automatically. This is mostly useful for testing. (KDM also has this feature, but it's nice not to depend on KDE for non-KDE tests.) svn path=/nixos/trunk/; revision=19239wip/yesman
parent
62476f2816
commit
73668f41da
@ -1,14 +1,7 @@ |
||||
{ |
||||
services = { |
||||
xserver = { |
||||
|
||||
desktopManager = { |
||||
session = [{ |
||||
name = "none"; |
||||
start = ""; |
||||
}]; |
||||
}; |
||||
|
||||
}; |
||||
}; |
||||
services.xserver.desktopManager.session = |
||||
[ { name = "none"; |
||||
start = ""; |
||||
} |
||||
]; |
||||
} |
||||
|
@ -0,0 +1,55 @@ |
||||
{ config, pkgs, ... }: |
||||
|
||||
with pkgs.lib; |
||||
|
||||
let |
||||
|
||||
dmcfg = config.services.xserver.displayManager; |
||||
cfg = dmcfg.auto; |
||||
|
||||
in |
||||
|
||||
{ |
||||
|
||||
###### interface |
||||
|
||||
options = { |
||||
|
||||
services.xserver.displayManager.auto = { |
||||
|
||||
enable = mkOption { |
||||
default = false; |
||||
description = '' |
||||
Whether to enable the fake "auto" display manager, which |
||||
automatically logs in the user specified in the |
||||
<option>user</option> option. This is mostly useful for |
||||
automated tests. |
||||
''; |
||||
}; |
||||
|
||||
user = mkOption { |
||||
default = "root"; |
||||
description = "The user account to login automatically."; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
}; |
||||
|
||||
|
||||
###### implementation |
||||
|
||||
config = mkIf cfg.enable { |
||||
|
||||
services.xserver.displayManager.job = |
||||
{ execCmd = |
||||
'' |
||||
${pkgs.xorg.xinit}/bin/xinit \ |
||||
${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \ |
||||
-- ${dmcfg.xserverBin} ${dmcfg.xserverArgs} |
||||
''; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
} |
Loading…
Reference in new issue