Fixing broken gtk icons in nixos while using KDE plasma 6
I went through an entire experience trying to fix broken/missing icons in gtk apps. I use kde plasma as my DE with breeze and breeze icons.
Adwaita and hicolor and stuff are installed, but apps like ghostty and trayscale were explicitly looking for icons only adwaita provides.
KDE was reporting "hicolor" as the gtk icon no matter what I tried for awhile. Finally fixed it with a three pronged fix. This issue happens on a fresh nixos install installing plasma and gtk and the related icon sets and booting up any gtk apps that use adwaita specific icons (which I believe is any app that uses libadwaita). So this should be helpful.
# EDIT
So that broke after a reboot, turns out there was still a race condition with dconf
I've updated the doc, but here's how we fixed the fix
The override service (Layer 3) was **silently failing** since deployment. gsettings requires compiled GNOME schemas (`gschemas.compiled`) which NixOS+KDE does not have anywhere in the system path — only Steam runtimes had them. The service exited with `No schemas installed` and status 1.
Icons appeared to work initially because home-manager's `dconf.settings` wrote the correct value at activation time, and kde-gtk-config hadn't overwritten it yet. After a reboot/relogin cycle, kde-gtk-config would stomp it back to "breeze" and the broken service couldn't fix it.
Fix: Replace `gsettings` with `dconf write` — dconf operates directly on the database without needing compiled schemas:
```# Before (broken on NixOS+KDE):
ExecStart = "${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface icon-theme Adwaita";
# After (works everywhere):
ExecStart = "${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/icon-theme \"'Adwaita'\"";
```
Note the nested quoting: dconf expects a GVariant string, so the value must be 'Adwaita' (with single quotes inside the double quotes).
**Lesson:** On NixOS with KDE (no GNOME), never use gsettings in systemd services or scripts. Always use dconf directly. gsettings is a convenience wrapper that requires schema compilation — a GNOME-ecosystem assumption that doesn't hold on KDE-only NixOS.
Adwaita and hicolor and stuff are installed, but apps like ghostty and trayscale were explicitly looking for icons only adwaita provides.
KDE was reporting "hicolor" as the gtk icon no matter what I tried for awhile. Finally fixed it with a three pronged fix. This issue happens on a fresh nixos install installing plasma and gtk and the related icon sets and booting up any gtk apps that use adwaita specific icons (which I believe is any app that uses libadwaita). So this should be helpful.
# EDIT
So that broke after a reboot, turns out there was still a race condition with dconf
I've updated the doc, but here's how we fixed the fix
The override service (Layer 3) was **silently failing** since deployment. gsettings requires compiled GNOME schemas (`gschemas.compiled`) which NixOS+KDE does not have anywhere in the system path — only Steam runtimes had them. The service exited with `No schemas installed` and status 1.
Icons appeared to work initially because home-manager's `dconf.settings` wrote the correct value at activation time, and kde-gtk-config hadn't overwritten it yet. After a reboot/relogin cycle, kde-gtk-config would stomp it back to "breeze" and the broken service couldn't fix it.
Fix: Replace `gsettings` with `dconf write` — dconf operates directly on the database without needing compiled schemas:
```# Before (broken on NixOS+KDE):
ExecStart = "${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface icon-theme Adwaita";
# After (works everywhere):
ExecStart = "${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/icon-theme \"'Adwaita'\"";
```
Note the nested quoting: dconf expects a GVariant string, so the value must be 'Adwaita' (with single quotes inside the double quotes).
**Lesson:** On NixOS with KDE (no GNOME), never use gsettings in systemd services or scripts. Always use dconf directly. gsettings is a convenience wrapper that requires schema compilation — a GNOME-ecosystem assumption that doesn't hold on KDE-only NixOS.