Skip to content

fix(snixembed): bundle librsvg + wrap with wrapGAppsHook3#195

Open
Bad3r wants to merge 1 commit intomainfrom
fix/snixembed-svg-loader
Open

fix(snixembed): bundle librsvg + wrap with wrapGAppsHook3#195
Bad3r wants to merge 1 commit intomainfrom
fix/snixembed-svg-loader

Conversation

@Bad3r
Copy link
Copy Markdown
Owner

@Bad3r Bad3r commented May 8, 2026

Summary

  • PR fix(i3wm): patch snixembed icon resolution #193 fixed two source defects in snixembed 0.3.3 but icons remain blank squares after deploy
  • Real root cause confirmed via GTK_DEBUG=icontheme: snixembed has no SVG loader at runtime. The upstream nixpkgs derivation never wraps the binary and never pulls librsvg, so GDK_PIXBUF_MODULE_FILE is unset and gdk-pixbuf cannot decode SVG. Modern icon themes ship status and panel icons as SVG only, so every named lookup ends in image-missing.
  • Add wrapGAppsHook3 + librsvg to the existing override so the wrapper sets GDK_PIXBUF_MODULE_FILE to a loaders.cache that registers libpixbufloader-svg.so.

Evidence

look up icon dir /etc/profiles/per-user/vx/share/icons/Qogir-Dark/22/panel
get icon suffix (cached): 2          # cache says SVG hit
...
looking up icon image-missing for scale 1   # but the file cannot be decoded

/proc/$pid/environ for the unwrapped snixembed shows no GDK_PIXBUF_MODULE_FILE. After this change the wrapped binary embeds --set GDK_PIXBUF_MODULE_FILE /nix/store/.../librsvg-2.61.4/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.

Test plan

  • nix develop -c pre-commit run --files modules/base/custom-packages-overlay.nix --hook-stage manual
  • nix flake check --accept-flake-config --no-build --offline
  • nix build .#nixosConfigurations.system76.pkgs.snixembed produces /nix/store/0i8phgxq14ixi69xra0rjhb4pfpbkzxw-snixembed-0.3.3 with a bin/snixembed wrapper plus bin/.snixembed-wrapped; strings on the wrapper shows the new env vars
  • GDK_PIXBUF_MODULE_FILE confirmed in the wrapped process environment
  • ./build.sh --host system76, then systemctl --user restart snixembed
  • visual check: flameshot, Remmina, ProtonVPN show their proper icons in i3bar

Tracked alongside #193 in #194.

PR #193 patched two source defects in snixembed 0.3.3 but missed
the runtime piece. The upstream nixpkgs derivation links against
gtk3 + libdbusmenu only and never wraps the binary, so
GDK_PIXBUF_MODULE_FILE is unset at runtime and gdk-pixbuf has no
SVG loader registered. Modern icon themes ship status and panel
icons exclusively as SVG (Qogir-Dark/22/panel/flameshot-tray.svg,
hicolor/.../status/org.remmina.Remmina-status.svg). With no SVG
loader, Gtk's StatusIcon resolves the cache hit, fails to load
the file, and falls back to image-missing. Confirmed via
GTK_DEBUG=icontheme: cache returns suffix=2 (SVG) for the right
panel/status directories, then "looking up icon image-missing".

Add wrapGAppsHook3 + librsvg so the resulting wrapper sets
GDK_PIXBUF_MODULE_FILE to a loaders.cache that registers
libpixbufloader-svg.so. Verified locally: the wrapped binary's
environment shows GDK_PIXBUF_MODULE_FILE pointing at
librsvg-2.61.4/.../loaders.cache and no image-missing falls
appear in GTK_DEBUG output.

Tracked in #194; the override is removed once upstream ships
0.3.4+ with both the source fixes and the librsvg wrap.
@github-project-automation github-project-automation Bot moved this to Backlog in ❄️ NixOS May 8, 2026
@Bad3r Bad3r added type(bug) Broken behavior or regression that needs fixing. area(home-manager) Home Manager modules, activation, or user-environment config. labels May 8, 2026
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 8, 2026

Claude finished @Bad3r's task in 1m 5s —— View job


Review

  • Read PR diff and inspect modules/base/custom-packages-overlay.nix
  • Verify override pattern (hooks, build inputs, patch chaining)
  • Check correctness of wrapGAppsHook3 + librsvg for snixembed's GTK3/dbusmenu-gtk3 stack

No issues found.
fix/snixembed-svg-loader

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the snixembed package override in modules/base/custom-packages-overlay.nix to resolve an issue where SVG tray icons failed to render in i3bar. The fix involves adding wrapGAppsHook3 to nativeBuildInputs and librsvg to buildInputs to ensure proper SVG support via gdk-pixbuf. The internal documentation was also updated to describe the three defects addressed by this override. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area(home-manager) Home Manager modules, activation, or user-environment config. type(bug) Broken behavior or regression that needs fixing.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant