Skip to content

Commit

Permalink
unixtools: fix subpackages to include ALL relevant manpages
Browse files Browse the repository at this point in the history
some tools have man sections other than `1`, which the previous logic
would omit. for example, `man 8 sysctl` was previously not linked into
the `unixtools.sysctl` package but now is.
  • Loading branch information
uninsane committed Dec 4, 2024
1 parent d1b7f8c commit ec2b988
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkgs/top-level/unixtools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let
singleBinary = cmd: providers: let
provider = providers.${stdenv.hostPlatform.parsed.kernel.name} or providers.linux;
bin = "${getBin provider}/bin/${cmd}";
manpage = "${getOutput "man" provider}/share/man/man1/${cmd}.1.gz";
manDir = "${getOutput "man" provider}/share/man";
in runCommand "${cmd}-${provider.name}" {
meta = {
mainProgram = cmd;
Expand All @@ -43,9 +43,12 @@ let
mkdir -p $out/bin
ln -s ${bin} $out/bin/${cmd}
if [ -f ${manpage} ]; then
mkdir -p $out/share/man/man1
ln -s ${manpage} $out/share/man/man1/${cmd}.1.gz
if [ -d ${manDir} ]; then
manpages=($(cd ${manDir} ; find . -name '${cmd}*'))
for manpage in "''${manpages[@]}"; do
mkdir -p $out/share/man/$(dirname $manpage)
ln -s ${manDir}/$manpage $out/share/man/$manpage
done
fi
'';

Expand Down

0 comments on commit ec2b988

Please sign in to comment.