1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 21:21:06 +00:00
nixpkgs/nixos/tests/xmonad.nix

42 lines
1.3 KiB
Nix
Raw Normal View History

2019-11-07 02:18:26 +00:00
import ./make-test-python.nix ({ pkgs, ...} : {
2017-09-04 19:03:20 +01:00
name = "xmonad";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
machine = { pkgs, ... }: {
2017-09-04 19:03:20 +01:00
imports = [ ./common/x11.nix ./common/user-account.nix ];
test-support.displayManager.auto.user = "alice";
services.xserver.displayManager.defaultSession = "none+xmonad";
2017-09-04 19:03:20 +01:00
services.xserver.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
extraPackages = with pkgs.haskellPackages; haskellPackages: [ xmobar ];
2018-11-28 22:08:20 +00:00
config = ''
import XMonad
import XMonad.Util.EZConfig
main = launch $ def `additionalKeysP` myKeys
myKeys = [ ("M-C-x", spawn "xterm") ]
'';
2017-09-04 19:03:20 +01:00
};
};
2019-11-07 02:18:26 +00:00
testScript = { nodes, ... }: let
user = nodes.machine.config.users.users.alice;
in ''
machine.wait_for_x()
machine.wait_for_file("${user.home}/.Xauthority")
machine.succeed("xauth merge ${user.home}/.Xauthority")
2019-12-13 16:16:59 +00:00
machine.send_key("alt-ctrl-x")
2019-11-07 02:18:26 +00:00
machine.wait_for_window("${user.name}.*machine")
machine.sleep(1)
machine.screenshot("terminal")
machine.wait_until_succeeds("xmonad --restart")
machine.sleep(3)
2019-12-13 16:16:59 +00:00
machine.send_key("alt-shift-ret")
2019-11-07 02:18:26 +00:00
machine.wait_for_window("${user.name}.*machine")
machine.sleep(1)
machine.screenshot("terminal")
2017-09-04 19:03:20 +01:00
'';
})