From 8e3ee433768f145f1f33786eb240192c7c65cd41 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 16 Sep 2025 12:30:45 -0400 Subject: [PATCH 1/4] 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 ''; From b97477410bc815e9cc2f2722d50a1ee21ede5666 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 16 Sep 2025 12:38:06 -0400 Subject: [PATCH 2/4] openvswitch: don't install completions to wrong location Signed-off-by: Ihar Hrachyshka --- pkgs/by-name/op/openvswitch/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/op/openvswitch/package.nix b/pkgs/by-name/op/openvswitch/package.nix index 927e99443f79..465312a8ab0b 100644 --- a/pkgs/by-name/op/openvswitch/package.nix +++ b/pkgs/by-name/op/openvswitch/package.nix @@ -100,6 +100,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; postInstall = '' + # Install bash completions in correct location + rm -f $out/etc/bash_completion.d/ovs-*.bash installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash From e1e73aeb4b115170d1289d351af8afd1111e1daa Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 16 Sep 2025 12:38:26 -0400 Subject: [PATCH 3/4] openvswitch: let installShellCompletion detect shell type by extension Signed-off-by: Ihar Hrachyshka --- pkgs/by-name/op/openvswitch/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/op/openvswitch/package.nix b/pkgs/by-name/op/openvswitch/package.nix index 465312a8ab0b..f21df7e9b0d4 100644 --- a/pkgs/by-name/op/openvswitch/package.nix +++ b/pkgs/by-name/op/openvswitch/package.nix @@ -102,8 +102,8 @@ stdenv.mkDerivation rec { postInstall = '' # Install bash completions in correct location rm -f $out/etc/bash_completion.d/ovs-*.bash - installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash - installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash + installShellCompletion utilities/ovs-appctl-bashcomp.bash + installShellCompletion utilities/ovs-vsctl-bashcomp.bash mkdir -p $tools/{bin,share/openvswitch/scripts} mv $out/share/openvswitch/bugtool-plugins $tools/share/openvswitch From 090c49f381d3d5ce206ed62619f6a5f8461cb968 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 16 Sep 2025 12:44:11 -0400 Subject: [PATCH 4/4] openvswitch: add booxter to maintainers Signed-off-by: Ihar Hrachyshka --- pkgs/by-name/op/openvswitch/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/op/openvswitch/package.nix b/pkgs/by-name/op/openvswitch/package.nix index f21df7e9b0d4..112f08c29488 100644 --- a/pkgs/by-name/op/openvswitch/package.nix +++ b/pkgs/by-name/op/openvswitch/package.nix @@ -163,6 +163,7 @@ stdenv.mkDerivation rec { license = lib.licenses.asl20; maintainers = with lib.maintainers; [ adamcstephens + booxter kmcopper netixx xddxdd