mirror of
https://github.com/nix-community/home-manager
synced 2024-12-19 08:19:48 +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:
parent
28b6c3670c
commit
b59f682e86
1 changed files with 10 additions and 6 deletions
|
@ -322,17 +322,21 @@ in {
|
||||||
|
|
||||||
generateCompletions = package:
|
generateCompletions = package:
|
||||||
pkgs.runCommand "${package.name}-fish-completions" {
|
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 ];
|
nativeBuildInputs = [ pkgs.python3 ];
|
||||||
buildInputs = [ cfg.package ];
|
buildInputs = [ cfg.package ];
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
} ''
|
} ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
if [ -d $src/share/man ]; then
|
for src in $srcs; do
|
||||||
find $src/share/man -type f \
|
if [ -d $src/share/man ]; then
|
||||||
| xargs python ${cfg.package}/share/fish/tools/create_manpage_completions.py --directory $out \
|
find $src/share/man -type f \
|
||||||
> /dev/null
|
| xargs python ${cfg.package}/share/fish/tools/create_manpage_completions.py --directory $out \
|
||||||
fi
|
> /dev/null
|
||||||
|
fi
|
||||||
|
done
|
||||||
'';
|
'';
|
||||||
in destructiveSymlinkJoin {
|
in destructiveSymlinkJoin {
|
||||||
name = "${config.home.username}-fish-completions";
|
name = "${config.home.username}-fish-completions";
|
||||||
|
|
Loading…
Reference in a new issue