Hi, I have been using NixOS and home-manager for a few weeks now, and I’m really enjoying the way it has augmented my configuration. However, I’ve recently run into an issue with XDG application defaults. If I view the contents of ~/.local/state/nix/profile/share/applications/prefapps.list
, I see a section called [Default Applications]
, which I could imagine being VERY useful for configuring various default applications for things such as: your web browser, text editor, terminal emulator, launcher, etc. I have not been able to find a way to affect these defaults through /etc/nixos/configuration.nix
nor with home-manager.
Another note about this file is that most of the listed defaults are applications I don’t even have installed, such as gvim (default editor), calcoo (default calculator), roxterm (default terminal emulator), and pcmanfm (default file manager).
I would really like to be able to affect these defaults to, for example:
- set Emacs as my default text editor
- set Wezterm as my default terminal
- set Thunar as my default file manager
Please note that I am very aware of environment variables such as EDITOR
, TERM
and
VISUAL
. While useful (and set to my preferred values on my Nix system), these variable in absolutely no way whatsoever have any effect on the behavior of xdg-open
. VISUAL
and EDITOR
are used by other command line applications (not xdg-open
), and the TERM
environment variable is not so much for setting your preferred application, as it is for telling your terminal emulator about your terminals’ capabilies.
Please note that I am also very aware of ~/.config/mimeapps.list
(and it’s accompanying home-manager modules), which is a perfectly useful file in it’s own right, but only allows the user to define default applications based on mime-type alone, which is not the same as prefapps.list
.
For reference, here is some of the content of the prefapps.list
file.
[Default Applications]
Launcher=xde-run.desktop
FileManager=pcmanfm.desktop
MailReader=claws-mail.desktop
TerminalEmulator=roxterm.desktop
TextEditor=gvim.desktop
WebBrowser=firefox.desktop
Calculator=calcoo.desktop