Skip to content

Commit

Permalink
fish: consider man pages from extraOutputsToInstall
Browse files Browse the repository at this point in the history
Some packages provide man pages in extraOutputs, e.g. tmux and
tmux.man.
  • Loading branch information
neosimsim authored and rycee committed Jun 24, 2023
1 parent 28b6c36 commit b59f682
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions modules/programs/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit b59f682

Please sign in to comment.