networkmanager-split: ship manpages

This commit is contained in:
2025-07-19 22:36:59 +00:00
parent 2d8dcb600c
commit bd735d4400
3 changed files with 17 additions and 8 deletions

View File

@@ -1,7 +1,8 @@
{ deepLinkIntoOwnPackage {
, modemmanager deepLinkIntoOwnPackage,
modemmanager,
}: }:
(deepLinkIntoOwnPackage modemmanager).overrideAttrs (base: { (deepLinkIntoOwnPackage modemmanager {}).overrideAttrs (base: {
outputs = [ "out" "daemon" "mmcli" ]; outputs = [ "out" "daemon" "mmcli" ];
postFixup = '' postFixup = ''
moveToOutput "" "$daemon" moveToOutput "" "$daemon"

View File

@@ -30,14 +30,22 @@ let
]; ];
}); });
in in
(deepLinkIntoOwnPackage networkmanager').overrideAttrs (base: { (deepLinkIntoOwnPackage networkmanager' { outputs = [ "doc" "man" "out" ]; }).overrideAttrs (base: {
outputs = [ "out" "daemon" "nmcli" ]; outputs = [ "out" "daemon" "nmcli" ];
postFixup = '' postFixup = ''
# assume all outputs (until mentioned later) are associated with the daemon:
moveToOutput "" "$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" moveToOutput "$f" "$nmcli"
done done
# ensure non-empty default output so the build doesn't fail # ensure non-empty default output so the build doesn't fail
mkdir "$out" mkdir "$out"
''; '';

View File

@@ -80,9 +80,9 @@
linkIntoOwnPackage pkg paths' linkIntoOwnPackage pkg paths'
; ;
deepLinkIntoOwnPackage = pkg: symlinkJoin { deepLinkIntoOwnPackage = pkg: { outputs ? [ "out" ] }: symlinkJoin {
name = pkg.pname or pkg.name; name = pkg.pname or pkg.name;
paths = [ pkg ]; paths = builtins.map (output: pkg."${output}") outputs;
meta = pkg.meta or {}; meta = pkg.meta or {};
postBuild = '' postBuild = ''
runHook postBuild runHook postBuild
@@ -94,7 +94,7 @@
# given some package, create a new package which symlinks every file of the original # given some package, create a new package which symlinks every file of the original
# *except* for its dbus files. # *except* for its dbus files.
# in addition, edit its .desktop files to clarify that it can't be "dbus activated". # 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. # 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 # unlike `rmDbusServices`, this won't work on *all* derivation types (e.g. runCommand), so you should