1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00

Merge pull request #42327 from bkchr/fix_plasma5_test

tests.plasma5: Fixes OCR in sddm by providing a custom theme
This commit is contained in:
Matthew Justin Bauer 2018-06-21 18:24:35 -04:00 committed by GitHub
commit fe948fd6b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,13 +6,28 @@ import ./make-test.nix ({ pkgs, ...} :
maintainers = [ ttuegel ]; maintainers = [ ttuegel ];
}; };
machine = { lib, ... }: { machine = { lib, ... }:
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 ]; imports = [ ./common/user-account.nix ];
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true; services.xserver.displayManager.sddm.enable = true;
services.xserver.displayManager.sddm.theme = "breeze-ocr-theme";
services.xserver.desktopManager.plasma5.enable = true; services.xserver.desktopManager.plasma5.enable = true;
services.xserver.desktopManager.default = "plasma5"; services.xserver.desktopManager.default = "plasma5";
virtualisation.memorySize = 1024; virtualisation.memorySize = 1024;
environment.systemPackages = [ sddm_theme ];
# fontconfig-penultimate-0.3.3 -> 0.3.4 broke OCR apparently, but no idea why. # fontconfig-penultimate-0.3.3 -> 0.3.4 broke OCR apparently, but no idea why.
nixpkgs.config.packageOverrides = superPkgs: { nixpkgs.config.packageOverrides = superPkgs: {
@ -30,7 +45,6 @@ import ./make-test.nix ({ pkgs, ...} :
xdo = "${pkgs.xdotool}/bin/xdotool"; xdo = "${pkgs.xdotool}/bin/xdotool";
in '' in ''
startAll; startAll;
# Wait for display manager to start # Wait for display manager to start
$machine->waitForText(qr/${user.description}/); $machine->waitForText(qr/${user.description}/);
$machine->screenshot("sddm"); $machine->screenshot("sddm");