On NixOS 25.11, I installed retroarch using home-manager’s programs.retroarch option, and I could use some help fixing why it won’t run from the app launcher.
On Gnome, it doesn’t launch from the app launcher. When I try running retroarch from the terminal, I get an error. And when I open a shell from Emacs and enter retroarch, I can run it no problem.
Here’s the error output I get when run from the terminal:
$ retroarch
(retroarch:10407): GLib-GIO-ERROR **: 05:38:26.276: Settings schema 'org.gtk.Settings.ColorChooser' is not installed
Trace/breakpoint trap (core dumped) retroarch
Then, I see that I can’t find org.gtk.Settings.ColorChooser in the terminal:
Any ideas? I tried installing Retroarch as a system package, and tried installing gtk3 and gsettings-desktop-schemas in both NixOS and Home-Manager to try to get org.gtk.Settings.ColorChooser in my envrionment.
Sounds like a packaging mistake to me, or perhaps you’re using the wrong retroarch package. Can you share your config?
Firstly, though, let’s explain the weird behavior. It boils down to environment variables.
The very big lesson to take away from this is this: Unless someone made a mistake, installing something “globally” is pointless on NixOS. This is to ensure that two packages can depend on different versions of the same library without interfering with one another. This extends to gsettings schemas.
For gsettings schemas specifically, they are read from XDG_DATA_DIRS. Each package that depends on gsettings schemas is “wrapped” so that directories with the schemas it needs are prepended to that variable.
Emacs is generally built with the gtk front-end, so emacs is wrapped with gsettings schemas. Since environment variables propagate, the schemas bundled with emacs are inherited by retroarch, and emacs just so happens to contain the schemas it needs.
Your gnome environment, being gtk4, is not wrapped with these gtk3 schemas, and hence retroarch doesn’t erroneously inherit the schemas.
What should be happening is that retroarch is wrapped with its own set of schemas (so that each package can work independently and use different versions of the same schema). This appears to be true given the derivation, but I don’t know what you’re using.
Thanks for the help - updating my NixOS flake fixed the issue
@TLATER, thanks for the excellent explanation of what was happening between Emacs and the terminal regarding environment variables. This was pointing to what I was suspecting - an issue with the derivation…which would’ve easily been fixed by updating to the latest 25.11…