From bd735d44004ec9e2ee64df2e2742d538b9899af5 Mon Sep 17 00:00:00 2001 From: Colin Date: Sat, 19 Jul 2025 22:36:59 +0000 Subject: [PATCH] networkmanager-split: ship manpages --- pkgs/by-name/modemmanager-split/package.nix | 7 ++++--- pkgs/by-name/networkmanager-split/package.nix | 12 ++++++++++-- pkgs/by-name/trivial-builders/package.nix | 6 +++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/modemmanager-split/package.nix b/pkgs/by-name/modemmanager-split/package.nix index 99268d491..2044cf2a1 100644 --- a/pkgs/by-name/modemmanager-split/package.nix +++ b/pkgs/by-name/modemmanager-split/package.nix @@ -1,7 +1,8 @@ -{ deepLinkIntoOwnPackage -, modemmanager +{ + deepLinkIntoOwnPackage, + modemmanager, }: -(deepLinkIntoOwnPackage modemmanager).overrideAttrs (base: { +(deepLinkIntoOwnPackage modemmanager {}).overrideAttrs (base: { outputs = [ "out" "daemon" "mmcli" ]; postFixup = '' moveToOutput "" "$daemon" diff --git a/pkgs/by-name/networkmanager-split/package.nix b/pkgs/by-name/networkmanager-split/package.nix index f793bf3c3..479c351e3 100644 --- a/pkgs/by-name/networkmanager-split/package.nix +++ b/pkgs/by-name/networkmanager-split/package.nix @@ -30,14 +30,22 @@ let ]; }); in -(deepLinkIntoOwnPackage networkmanager').overrideAttrs (base: { +(deepLinkIntoOwnPackage networkmanager' { outputs = [ "doc" "man" "out" ]; }).overrideAttrs (base: { outputs = [ "out" "daemon" "nmcli" ]; postFixup = '' + # assume all outputs (until mentioned later) are associated with the daemon: moveToOutput "" "$daemon" - for f in bin/{nmcli,nmtui,nmtui-connect,nmtui-edit,nmtui-hostname} share/bash-completion/completions/nmcli; do + + # move select outputs to `nmcli`: + for f in \ + bin/{nmcli,nmtui,nmtui-connect,nmtui-edit,nmtui-hostname} \ + share/bash-completion/completions/nmcli \ + share/man/man1/{nmcli,nmtui,nmtui-connect,nmtui-edit,nmtui-hostname}.1.gz \ + ; do moveToOutput "$f" "$nmcli" done + # ensure non-empty default output so the build doesn't fail mkdir "$out" ''; diff --git a/pkgs/by-name/trivial-builders/package.nix b/pkgs/by-name/trivial-builders/package.nix index 737d4f393..0eb8e82d9 100644 --- a/pkgs/by-name/trivial-builders/package.nix +++ b/pkgs/by-name/trivial-builders/package.nix @@ -80,9 +80,9 @@ linkIntoOwnPackage pkg paths' ; - deepLinkIntoOwnPackage = pkg: symlinkJoin { + deepLinkIntoOwnPackage = pkg: { outputs ? [ "out" ] }: symlinkJoin { name = pkg.pname or pkg.name; - paths = [ pkg ]; + paths = builtins.map (output: pkg."${output}") outputs; meta = pkg.meta or {}; postBuild = '' runHook postBuild @@ -94,7 +94,7 @@ # given some package, create a new package which symlinks every file of the original # *except* for its dbus files. # in addition, edit its .desktop files to clarify that it can't be "dbus activated". - rmDbusServices = pkg: rmDbusServicesInPlace (deepLinkIntoOwnPackage pkg); + rmDbusServices = pkg: rmDbusServicesInPlace (deepLinkIntoOwnPackage pkg {}); # like rmDbusServices, but do it by patching the derivation instead of wrapping it. # unlike `rmDbusServices`, this won't work on *all* derivation types (e.g. runCommand), so you should