mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 05:31:22 +00:00
5fa8cd257a
xmonad service: add .config option
40 lines
1.3 KiB
Nix
40 lines
1.3 KiB
Nix
import ./make-test.nix ({ pkgs, ...} : {
|
|
name = "xmonad";
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
maintainers = [ nequissimus ];
|
|
};
|
|
|
|
machine = { lib, pkgs, ... }: {
|
|
imports = [ ./common/x11.nix ./common/user-account.nix ];
|
|
services.xserver.displayManager.auto.user = "alice";
|
|
services.xserver.windowManager.default = lib.mkForce "xmonad";
|
|
services.xserver.windowManager.xmonad = {
|
|
enable = true;
|
|
enableContribAndExtras = true;
|
|
extraPackages = with pkgs.haskellPackages; haskellPackages: [ xmobar ];
|
|
config = ''
|
|
import XMonad
|
|
import XMonad.Util.EZConfig
|
|
main = launch $ def `additionalKeysP` myKeys
|
|
myKeys = [ ("M-C-x", spawn "xterm") ]
|
|
'';
|
|
};
|
|
};
|
|
|
|
testScript = { ... }: ''
|
|
$machine->waitForX;
|
|
$machine->waitForFile("/home/alice/.Xauthority");
|
|
$machine->succeed("xauth merge ~alice/.Xauthority");
|
|
$machine->sendKeys("alt-ctrl-x");
|
|
$machine->waitForWindow(qr/machine.*alice/);
|
|
$machine->sleep(1);
|
|
$machine->screenshot("terminal");
|
|
$machine->waitUntilSucceeds("xmonad --restart");
|
|
$machine->sleep(3);
|
|
$machine->sendKeys("alt-shift-ret");
|
|
$machine->waitForWindow(qr/alice.*machine/);
|
|
$machine->sleep(1);
|
|
$machine->screenshot("terminal");
|
|
'';
|
|
})
|