2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-03 02:33:15 +00:00
nixpkgs/nixos/tests/qtile/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.5 KiB
Nix
Raw Normal View History

import ../make-test-python.nix (
{ lib, ... }:
{
name = "qtile";
2024-04-22 17:00:41 +00:00
meta = {
maintainers = with lib.maintainers; [ sigmanificient ];
};
2024-04-22 17:00:41 +00:00
nodes.machine =
{ pkgs, lib, ... }:
let
# We create a custom Qtile configuration file that adds a widget from
# qtile-extras to the bar. This ensure that the qtile-extras package
# also works, and that extraPackages behave as expected.
config-deriv = pkgs.callPackage ./config.nix { };
in
{
imports = [
../common/x11.nix
../common/user-account.nix
];
2024-04-22 17:00:41 +00:00
test-support.displayManager.auto.user = "alice";
services.xserver.windowManager.qtile = {
enable = true;
configFile = "${config-deriv}/config.py";
extraPackages = ps: [ ps.qtile-extras ];
};
services.displayManager.defaultSession = lib.mkForce "qtile";
2024-04-22 17:00:41 +00:00
environment.systemPackages = [ pkgs.kitty ];
};
2024-04-22 17:00:41 +00:00
testScript = ''
with subtest("ensure x starts"):
machine.wait_for_x()
machine.wait_for_file("/home/alice/.Xauthority")
machine.succeed("xauth merge ~alice/.Xauthority")
2024-04-22 17:00:41 +00:00
with subtest("ensure client is available"):
machine.succeed("qtile --version")
2024-04-22 17:00:41 +00:00
with subtest("ensure we can open a new terminal"):
machine.sleep(2)
machine.send_key("meta_l-ret")
machine.wait_for_window(r"alice.*?machine")
machine.sleep(2)
machine.screenshot("terminal")
'';
}
)