dunst: add option to read alternative configuration file (#2113)

This commit is contained in:
Ctem 2021-08-08 09:44:36 +09:00 committed by GitHub
parent b0d769691c
commit 59be1f4983
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,21 @@ in {
description = "Package providing <command>dunst</command>.";
};
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.
</para><para>
Note that the configuration generated by Home Manager will be
written to <filename>$XDG_CONFIG_HOME/dunst/dunstrc</filename>
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 <filename>$XDG_CONFIG_HOME/dunst/dunstrc</filename>.";
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}";
};