2016-06-01 16:05:46 +01:00
|
|
|
import ./make-test.nix ({ pkgs, ...} :
|
|
|
|
|
|
|
|
{
|
2017-03-03 13:25:45 +00:00
|
|
|
name = "plasma5";
|
2015-12-11 13:08:07 +00:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ ttuegel ];
|
|
|
|
};
|
|
|
|
|
2018-07-20 21:56:59 +01:00
|
|
|
machine = { ... }:
|
2018-06-21 13:52:54 +01:00
|
|
|
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
|
|
|
|
{
|
2015-12-11 13:08:07 +00:00
|
|
|
imports = [ ./common/user-account.nix ];
|
|
|
|
services.xserver.enable = true;
|
2017-03-24 13:02:24 +00:00
|
|
|
services.xserver.displayManager.sddm.enable = true;
|
2018-06-21 13:52:54 +01:00
|
|
|
services.xserver.displayManager.sddm.theme = "breeze-ocr-theme";
|
2017-03-01 01:09:56 +00:00
|
|
|
services.xserver.desktopManager.plasma5.enable = true;
|
|
|
|
services.xserver.desktopManager.default = "plasma5";
|
2018-10-28 19:11:17 +00:00
|
|
|
services.xserver.displayManager.sddm.autoLogin = {
|
|
|
|
enable = true;
|
|
|
|
user = "alice";
|
|
|
|
};
|
2019-09-10 03:17:18 +01:00
|
|
|
hardware.pulseaudio.enable = true; # needed for the factl test, /dev/snd/* exists without them but udev doesn't care then
|
2017-03-24 13:02:24 +00:00
|
|
|
virtualisation.memorySize = 1024;
|
2018-06-21 13:52:54 +01:00
|
|
|
environment.systemPackages = [ sddm_theme ];
|
2015-12-11 13:08:07 +00:00
|
|
|
};
|
|
|
|
|
2017-03-24 13:02:24 +00:00
|
|
|
testScript = { nodes, ... }: let
|
2018-06-30 00:55:42 +01:00
|
|
|
user = nodes.machine.config.users.users.alice;
|
2017-03-24 13:02:24 +00:00
|
|
|
xdo = "${pkgs.xdotool}/bin/xdotool";
|
|
|
|
in ''
|
2016-09-09 16:09:45 +01:00
|
|
|
startAll;
|
2018-10-28 19:11:17 +00:00
|
|
|
# wait for log in
|
2016-09-09 16:09:45 +01:00
|
|
|
$machine->waitForFile("/home/alice/.Xauthority");
|
|
|
|
$machine->succeed("xauth merge ~alice/.Xauthority");
|
2016-06-01 16:05:46 +01:00
|
|
|
|
|
|
|
$machine->waitUntilSucceeds("pgrep plasmashell");
|
2016-09-09 16:09:45 +01:00
|
|
|
$machine->waitForWindow("^Desktop ");
|
2016-06-01 16:05:46 +01:00
|
|
|
|
|
|
|
# Check that logging in has given the user ownership of devices.
|
|
|
|
$machine->succeed("getfacl /dev/snd/timer | grep -q alice");
|
2016-09-09 16:09:45 +01:00
|
|
|
|
|
|
|
$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");
|
2016-06-01 16:05:46 +01:00
|
|
|
|
|
|
|
$machine->execute("${xdo} key Alt+F1 sleep 10");
|
|
|
|
$machine->screenshot("screen");
|
2015-12-11 13:08:07 +00:00
|
|
|
'';
|
|
|
|
})
|