From fb21562ad7baea5dc850ea0300746f2d16e82a2c Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 16 Sep 2025 22:24:28 +0000 Subject: [PATCH] ovn: split out lib, man, dev, and tools This drastically reduces the size of the main service closure, mainly because python is no longer in it (used for auxiliary client side debug tools). For static build, closure size went 387.7M -> 115.0M. --- pkgs/by-name/ov/ovn/package.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/by-name/ov/ovn/package.nix b/pkgs/by-name/ov/ovn/package.nix index a9f06b176eeb..ba05304c0f67 100644 --- a/pkgs/by-name/ov/ovn/package.nix +++ b/pkgs/by-name/ov/ovn/package.nix @@ -32,6 +32,14 @@ stdenv.mkDerivation (finalAttrs: { fetchSubmodules = true; }; + outputs = [ + "out" + "lib" + "man" + "dev" + "tools" + ]; + patches = [ # Fix test failure with musl libc. (fetchpatch { @@ -91,6 +99,15 @@ stdenv.mkDerivation (finalAttrs: { ]; postInstall = '' + moveToOutput 'share/ovn/bugtool-plugins' "$tools" + moveToOutput 'share/ovn/scripts/ovn-bugtool-*' "$tools" + + moveToOutput 'bin/ovn-detrace' "$tools" + moveToOutput 'bin/ovn_detrace*' "$tools" + moveToOutput 'bin/ovn-trace' "$tools" + moveToOutput 'bin/ovn-debug' "$tools" + moveToOutput 'bin/ovn-docker*' "$tools" + sed -i '/chown -R $INSTALL_USER:$INSTALL_GROUP $ovn_etcdir/d' $out/share/ovn/scripts/ovn-ctl mkdir -vp $out/share/openvswitch/scripts