From 3aa479d55101346fffe49235caf39566c4b62732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Thu, 17 Jun 2021 03:06:16 +0200 Subject: [PATCH] dunst: make icon_path extensible (#2097) --- modules/services/dunst.nix | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index f8d29ebf..cf832f4b 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -78,7 +78,15 @@ in { }; settings = mkOption { - type = with types; attrsOf (attrsOf eitherStrBoolIntList); + type = types.submodule { + freeformType = with types; attrsOf (attrsOf eitherStrBoolIntList); + options = { + global.icon_path = mkOption { + type = types.separatedString ":"; + description = "Paths where dunst will look for icons."; + }; + }; + }; default = { }; description = "Configuration written to ~/.config/dunst/dunstrc"; example = literalExample '' @@ -138,11 +146,14 @@ in { "status" "stock" ]; - in concatStringsSep ":" (concatMap (theme: - concatMap (basePath: - map (category: - "${basePath}/share/icons/${theme.name}/${theme.size}/${category}") - categories) basePaths) themes); + + mkPath = { basePath, theme, category }: + "${basePath}/share/icons/${theme.name}/${theme.size}/${category}"; + in concatMapStringsSep ":" mkPath (cartesianProductOfSets { + basePath = basePaths; + theme = themes; + category = categories; + }); systemd.user.services.dunst = { Unit = {