nixosTests.lomiri: Replace wallpaper service with Dconf setting

Still doesn't work in the VM though.
This commit is contained in:
OPNA2608 2025-08-01 22:07:25 +02:00
parent d1cef34d09
commit 4529ed9114

View File

@ -66,50 +66,14 @@ let
''
magick -size 640x480 canvas:white -pointsize 30 -fill black -annotate +100+100 '${wallpaperText}' $out
'';
# gsettings tool with access to wallpaper schema
lomiri-gsettings =
pkgs:
pkgs.stdenv.mkDerivation {
name = "lomiri-gsettings";
dontUnpack = true;
nativeBuildInputs = with pkgs; [
glib
wrapGAppsHook3
];
buildInputs = with pkgs; [
# Not using the Lomiri-namespaced setting yet
# lomiri.lomiri-schemas
gsettings-desktop-schemas
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
ln -s ${pkgs.lib.getExe' pkgs.glib "gsettings"} $out/bin/lomiri-gsettings
runHook postInstall
'';
};
setLomiriWallpaperService =
pkgs:
let
lomiriServices = [
"lomiri.service"
"lomiri-full-greeter.service"
"lomiri-full-shell.service"
"lomiri-greeter.service"
"lomiri-shell.service"
];
in
rec {
description = "Set Lomiri wallpaper to something OCR-able";
wantedBy = lomiriServices;
before = lomiriServices;
serviceConfig = {
Type = "oneshot";
# Not using the Lomiri-namespaed settings yet
# ExecStart = "${lomiri-gsettings pkgs}/bin/lomiri-gsettings set com.lomiri.Shell background-picture-uri file://${wallpaperFile pkgs}";
ExecStart = "${lomiri-gsettings pkgs}/bin/lomiri-gsettings set org.gnome.desktop.background picture-uri file://${wallpaperFile pkgs}";
lomiriWallpaperDconfSettings = pkgs: {
settings = {
"org/gnome/desktop/background" = {
picture-uri = "file://${wallpaperFile pkgs}";
};
};
};
sharedTestFunctions = ''
def wait_for_text(text):
@ -413,12 +377,14 @@ in
];
};
programs.dconf.profiles.user.databases = [
(lomiriWallpaperDconfSettings pkgs)
];
# Help with OCR
systemd.tmpfiles.settings = {
"10-lomiri-test-setup" = terminalOcrTmpfilesSetup { inherit pkgs lib config; };
};
systemd.user.services.set-lomiri-wallpaper = setLomiriWallpaperService pkgs;
};
enableOCR = true;
@ -562,12 +528,14 @@ in
];
};
programs.dconf.profiles.user.databases = [
(lomiriWallpaperDconfSettings pkgs)
];
# Help with OCR
systemd.tmpfiles.settings = {
"10-lomiri-test-setup" = terminalOcrTmpfilesSetup { inherit pkgs lib config; };
};
systemd.user.services.set-lomiri-wallpaper = setLomiriWallpaperService pkgs;
};
enableOCR = true;
@ -710,7 +678,9 @@ in
environment.etc."${wallpaperName}".source = wallpaperFile pkgs;
systemd.user.services.set-lomiri-wallpaper = setLomiriWallpaperService pkgs;
programs.dconf.profiles.user.databases = [
(lomiriWallpaperDconfSettings pkgs)
];
# Help with OCR
systemd.tmpfiles.settings = {