1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-24 18:59:47 +01:00

fish: consider man pages from extraOutputsToInstall

Some packages provide man pages in extraOutputs, e.g. tmux and
tmux.man.
This commit is contained in:
Alexander Ben Nasrallah 2022-05-01 12:52:16 +02:00 committed by Robert Helgesson
parent 28b6c3670c
commit b59f682e86
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -322,17 +322,21 @@ in {
generateCompletions = package:
pkgs.runCommand "${package.name}-fish-completions" {
src = package;
srcs = [ package ] ++ filter (p: p != null)
(builtins.map (outName: package.${outName} or null)
config.home.extraOutputsToInstall);
nativeBuildInputs = [ pkgs.python3 ];
buildInputs = [ cfg.package ];
preferLocalBuild = true;
} ''
mkdir -p $out
if [ -d $src/share/man ]; then
find $src/share/man -type f \
| xargs python ${cfg.package}/share/fish/tools/create_manpage_completions.py --directory $out \
> /dev/null
fi
for src in $srcs; do
if [ -d $src/share/man ]; then
find $src/share/man -type f \
| xargs python ${cfg.package}/share/fish/tools/create_manpage_completions.py --directory $out \
> /dev/null
fi
done
'';
in destructiveSymlinkJoin {
name = "${config.home.username}-fish-completions";