diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix
index cf832f4bf..0f09d4146 100644
--- a/modules/services/dunst.nix
+++ b/modules/services/dunst.nix
@@ -64,6 +64,21 @@ in {
description = "Package providing dunst.";
};
+ configFile = mkOption {
+ type = with types; either str path;
+ default = "${config.xdg.configHome}/dunst/dunstrc";
+ defaultText = "$XDG_CONFIG_HOME/dunst/dunstrc";
+ description = ''
+ 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.
+ '';
+ };
+
iconTheme = mkOption {
type = themeType;
default = hicolorTheme;
@@ -88,7 +103,8 @@ in {
};
};
default = { };
- description = "Configuration written to ~/.config/dunst/dunstrc";
+ description =
+ "Configuration written to $XDG_CONFIG_HOME/dunst/dunstrc.";
example = literalExample ''
{
global = {
@@ -165,7 +181,7 @@ in {
Service = {
Type = "dbus";
BusName = "org.freedesktop.Notifications";
- ExecStart = "${cfg.package}/bin/dunst";
+ ExecStart = "${cfg.package}/bin/dunst -config ${cfg.configFile}";
Environment = optionalString (cfg.waylandDisplay != "")
"WAYLAND_DISPLAY=${cfg.waylandDisplay}";
};