nixpkgs-suyu/nixos/tests/plasma5.nix

76 lines
2.5 KiB
Nix
Raw Normal View History

import ./make-test.nix ({ pkgs, ...} :
{
2017-03-03 14:25:45 +01:00
name = "plasma5";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ ttuegel ];
};
machine = { ... }:
let
sddm_theme = pkgs.stdenv.mkDerivation {
name = "breeze-ocr-theme";
phases = "buildPhase";
buildCommand = ''
mkdir -p $out/share/sddm/themes/
cp -r ${pkgs.plasma-workspace}/share/sddm/themes/breeze $out/share/sddm/themes/breeze-ocr-theme
chmod -R +w $out/share/sddm/themes/breeze-ocr-theme
printf "[General]\ntype=color\ncolor=#1d99f3\nbackground=\n" > $out/share/sddm/themes/breeze-ocr-theme/theme.conf
'';
};
in
{
imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
2017-03-24 14:02:24 +01:00
services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.theme = "breeze-ocr-theme";
2017-03-01 02:09:56 +01:00
services.xserver.desktopManager.plasma5.enable = true;
services.xserver.desktopManager.default = "plasma5";
2017-03-24 14:02:24 +01:00
virtualisation.memorySize = 1024;
environment.systemPackages = [ sddm_theme ];
# fontconfig-penultimate-0.3.3 -> 0.3.4 broke OCR apparently, but no idea why.
nixpkgs.config.packageOverrides = superPkgs: {
2017-08-11 21:53:01 +02:00
fontconfig-penultimate = superPkgs.fontconfig-penultimate.override {
version = "0.3.3";
2017-08-12 00:55:32 +02:00
sha256 = "1z76jbkb0nhf4w7fy647yyayqr4q02fgk6w58k0yi700p0m3h4c9";
2017-08-11 21:53:01 +02:00
};
};
};
2017-03-24 14:02:24 +01:00
enableOCR = true;
testScript = { nodes, ... }: let
user = nodes.machine.config.users.users.alice;
2017-03-24 14:02:24 +01:00
xdo = "${pkgs.xdotool}/bin/xdotool";
in ''
startAll;
2017-03-24 14:02:24 +01:00
# Wait for display manager to start
$machine->waitForText(qr/${user.description}/);
$machine->screenshot("sddm");
# Log in
$machine->sendChars("${user.password}\n");
$machine->waitForFile("/home/alice/.Xauthority");
$machine->succeed("xauth merge ~alice/.Xauthority");
$machine->waitUntilSucceeds("pgrep plasmashell");
$machine->waitForWindow("^Desktop ");
# Check that logging in has given the user ownership of devices.
$machine->succeed("getfacl /dev/snd/timer | grep -q alice");
$machine->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'");
$machine->waitForWindow(" Dolphin");
$machine->execute("su - alice -c 'DISPLAY=:0.0 konsole &'");
$machine->waitForWindow("Konsole");
$machine->execute("su - alice -c 'DISPLAY=:0.0 systemsettings5 &'");
$machine->waitForWindow("Settings");
$machine->execute("${xdo} key Alt+F1 sleep 10");
$machine->screenshot("screen");
'';
})