Home-manager services.dunst.configFile and icon_path

According to services.dunst.configFile - MyNixOS

services.dunst.configFile

Path to the configuration file read by dunst.

Note that the configuration generated by Home Manager will be written to $XDG_CONFIG_HOME/dunst/dunstrc regardless. This allows using a mutable configuration file generated from the immutable one, useful in scenarios where live reloading is desired.

The home-manager-generated dunstrc contains a (very long) setting for icon_path. How could I get this value to be included automatically in the settings specified in services.dunst.configFile, while

  1. keeping the live reloading convenience
  2. not having to maintain the icon_path by hand

?

You could put a literal @whatever@ in the config file and use replaceVars to substitute it later on in your hm config.

I’m struggling to see how this would let me modify the config file and see the effect the modification has, without having to run home-manager switch (the live reloading requirement).

IIUC, you’re suggesting that my editable-by-hand config file contain @xxx@ and home-manager would replace it with the real value to generate the config file that is seen by dunst. Thus modifying this file without rerunning HM switch would not have any effect on dunst’s behaviour.

I mean, if you want a store path in your config, you have to rebuild…

If dunst config files supported some kind of include (there is an open issue which has made no progress for 3 years), then I could include the HM-generated config containing the store path in my hand-written config, and this would give exactly what I want: HM takes care of icon_path, my hand-written config takes care of everything else, and they compose just fine without breaking each other or needing extra steps.

It could definitely work in principle. The question is whether some enabling mechanism (e.g. dunst config includes) exists. I haven’t found one, but my ignorance doesn’t prove anything.

Then you’re looking for a solution outside of the nix context, nix’s job is to build things.

I’m looking for an ergonomic and pragmatic solution in the context of the fact that I’m using home-manager. Strictly limiting it to Nix is a non-goal.