fish: support theme plugins

Allows for linking fish plugin theme files to [fish's themes
folder](https://fishshell.com/docs/current/cmds/fish_config.html#theme-files).
Fully allowing for theme plugins to properly be installed declaratively.
Fixes nix-community/home-manager#3724
This commit is contained in:
NovaViper 2025-09-28 23:17:37 -05:00 committed by Austin Horstman
parent dcf52ade95
commit 5a21f4819e
3 changed files with 63 additions and 0 deletions

View file

@ -765,6 +765,30 @@ in
}) cfg.plugins
);
})
(
let
themes = lib.foldl (
themeList: plugin:
if lib.pathIsDirectory "${plugin.src}/themes" then
themeList ++ lib.filesystem.listFilesRecursive "${plugin.src}/themes"
else
themeList
) [ ] cfg.plugins;
in
(mkIf (lib.length themes > 0) {
xdg.configFile = lib.mkMerge (
map (
theme:
let
basename = lib.last (builtins.split "/" (toString theme));
in
{
"fish/themes/${basename}".source = theme;
}
) themes
);
})
)
]
);
}