From 827636c619ce0d8178ddc08ab86ee92b50f2e5b4 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sat, 24 Apr 2021 23:56:48 -0600 Subject: [PATCH] dunst: add service package option (#1944) * add service package option * add waylandDisplay option dunst now supports wayland, and looks for WAYLAND_DISPLAY var to use it Co-authored-by: @li:maisiliym.uniks <@li:maisiliym.uniks> --- modules/services/dunst.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index 60842a167..90c3160fc 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -57,12 +57,26 @@ in { services.dunst = { enable = mkEnableOption "the dunst notification daemon"; + package = mkOption { + type = types.package; + default = pkgs.dunst; + defaultText = literalExample "pkgs.dunst"; + description = "Package providing dunst."; + }; + iconTheme = mkOption { type = themeType; default = hicolorTheme; description = "Set the icon theme."; }; + waylandDisplay = mkOption { + type = types.str; + default = ""; + description = + "Set the service's WAYLAND_DISPLAY environment variable."; + }; + settings = mkOption { type = with types; attrsOf (attrsOf eitherStrBoolIntList); default = { }; @@ -140,7 +154,9 @@ in { Service = { Type = "dbus"; BusName = "org.freedesktop.Notifications"; - ExecStart = "${pkgs.dunst}/bin/dunst"; + ExecStart = "${cfg.package}/bin/dunst"; + Environment = optionalString (cfg.waylandDisplay != "") + "WAYLAND_DISPLAY=${cfg.waylandDisplay}"; }; }; }