mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 16:45:51 +03:00
* Added an "auto" pseudo display manager that logs in a user
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=19239
This commit is contained in:
parent
62476f2816
commit
73668f41da
@ -112,12 +112,14 @@
|
||||
./services/x11/desktop-managers/none.nix
|
||||
./services/x11/desktop-managers/xterm.nix
|
||||
./services/x11/display-managers/default.nix
|
||||
./services/x11/display-managers/auto.nix
|
||||
./services/x11/display-managers/kdm.nix
|
||||
./services/x11/display-managers/slim.nix
|
||||
./services/x11/hardware/synaptics.nix
|
||||
./services/x11/hardware/wacom.nix
|
||||
./services/x11/window-managers/compiz.nix
|
||||
./services/x11/window-managers/default.nix
|
||||
./services/x11/window-managers/icewm.nix
|
||||
./services/x11/window-managers/kwm.nix
|
||||
./services/x11/window-managers/metacity.nix
|
||||
./services/x11/window-managers/none.nix
|
||||
|
@ -1,14 +1,7 @@
|
||||
{
|
||||
services = {
|
||||
xserver = {
|
||||
|
||||
desktopManager = {
|
||||
session = [{
|
||||
name = "none";
|
||||
services.xserver.desktopManager.session =
|
||||
[ { name = "none";
|
||||
start = "";
|
||||
}];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
55
modules/services/x11/display-managers/auto.nix
Normal file
55
modules/services/x11/display-managers/auto.nix
Normal file
@ -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}
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -72,7 +72,7 @@ in
|
||||
enableXDMCP = mkOption {
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable XDMCP, which allows remote logins";
|
||||
Whether to enable XDMCP, which allows remote logins.
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -6,7 +6,15 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{ services.xserver.enable = true;
|
||||
environment.systemPackages = [ pkgs.icewm pkgs.firefox ];
|
||||
services.xserver.displayManager.slim.enable = false;
|
||||
services.xserver.displayManager.auto.enable = true;
|
||||
|
||||
services.xserver.windowManager.default = "icewm";
|
||||
services.xserver.windowManager.icewm.enable = true;
|
||||
|
||||
services.xserver.desktopManager.default = "none";
|
||||
|
||||
environment.systemPackages = [ pkgs.firefox ];
|
||||
};
|
||||
|
||||
testScript =
|
||||
@ -15,10 +23,6 @@
|
||||
|
||||
sleep 10;
|
||||
|
||||
$machine->execute("DISPLAY=:0.0 icewm &");
|
||||
|
||||
sleep 10;
|
||||
|
||||
$machine->execute("DISPLAY=:0.0 HOME=/root firefox file://${pkgs.valgrind}/share/doc/valgrind/html/index.html &");
|
||||
|
||||
sleep 30;
|
||||
|
Loading…
Reference in New Issue
Block a user