From 8e3ee433768f145f1f33786eb240192c7c65cd41 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 16 Sep 2025 12:30:45 -0400 Subject: [PATCH] openvswitch: split out dev, lib and tools Most non-essential tools were moved to $tools output. Only services (vswitchd and ovsdb-server) as well as their respective clients (-ctl) are left in the default output. Some helper scripts (ovs-ctl, ovs-save, ovs-kmod-ctl) are left in the main output since they are related to basic service startup and, frankly, they also don't pull any additional dependencies (except bash). This allows to drastically reduce the size of the closure since the default `out` no longer pulls python. Before: 224.6M After: 85.2M Signed-off-by: Ihar Hrachyshka --- pkgs/by-name/op/openvswitch/package.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/op/openvswitch/package.nix b/pkgs/by-name/op/openvswitch/package.nix index 40b9f127a031..927e99443f79 100644 --- a/pkgs/by-name/op/openvswitch/package.nix +++ b/pkgs/by-name/op/openvswitch/package.nix @@ -41,7 +41,10 @@ stdenv.mkDerivation rec { outputs = [ "out" + "dev" + "lib" "man" + "tools" ]; patches = [ @@ -100,10 +103,16 @@ stdenv.mkDerivation rec { installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash - wrapProgram $out/bin/ovs-l3ping \ + mkdir -p $tools/{bin,share/openvswitch/scripts} + mv $out/share/openvswitch/bugtool-plugins $tools/share/openvswitch + mv $out/share/openvswitch/scripts/ovs-{bugtool*,check-dead-ifs,monitor-ipsec,vtep} $tools/share/openvswitch/scripts + mv $out/share/openvswitch/scripts/usdt $tools/share/openvswitch/scripts + mv $out/bin/ovs-{bugtool,dpctl-top,l3ping,parse-backtrace,pcap,tcpdump,tcpundump,test,vlan-test} $tools/bin + + wrapProgram $tools/bin/ovs-l3ping \ --prefix PYTHONPATH : $out/share/openvswitch/python - wrapProgram $out/bin/ovs-tcpdump \ + wrapProgram $tools/bin/ovs-tcpdump \ --prefix PATH : ${lib.makeBinPath [ tcpdump ]} \ --prefix PYTHONPATH : $out/share/openvswitch/python '';