{lib}: theme: let
inherit (builtins) isAttrs mapAttrs concatStringsSep;
inherit (lib) flatten removePrefix;
recurse = path: f: val:
if isAttrs val
then mapAttrs (n: v: recurse (path + "." + n) f v) val
else f path val;
recurse' = recurse "theme";
in
theme
// {
noHash = recurse' (_: color: removePrefix "#" color) theme;
apps =
{
helix = import ./helix.nix theme;
qutebrowser = import ./qutebrowser.nix theme;
zellij = import ./zellij.nix theme;
}
// (theme.apps or {});
}