From 4529ed911451f941ae8f79218abe7c9f46e7e874 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 1 Aug 2025 22:07:25 +0200 Subject: [PATCH] nixosTests.lomiri: Replace wallpaper service with Dconf setting Still doesn't work in the VM though. --- nixos/tests/lomiri.nix | 64 +++++++++++------------------------------- 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/nixos/tests/lomiri.nix b/nixos/tests/lomiri.nix index 42c93f3070f8..b332fcba8da2 100644 --- a/nixos/tests/lomiri.nix +++ b/nixos/tests/lomiri.nix @@ -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 = {