wireshark: ln ext bins to $out for discoverability

This change shouldn't increase the closure size except for a few bytes
for the symlinks, since the binaries are already included in the package
anyway. And it will cause e.g. androiddump to appear on
https://search.nixos.org/ while also adding all the extcap
binaries to your path when using wireshark from a nix-shell.

The change is guarded behind a optional flag for stdenv.hostPlatform.isLinux,
because darwin doesn't appear to ship the extra bins. I don't currently
have a darwin system on hand for testing, but used:

```bash
curl https://cache.nixos.org/nar/0m8147jar72c94gs1ryfrigiiq0gn52dqpw3f3bbnp0rhk3xb4q4.nar.xz -o /tmp/wireshark.nar.xz
cat wireshark.nar.xz | xz -dc | nix-store --restore /tmp/darwin-wireshark
tree /tmp/darwin-wireshark
```

to check that this is the case.
The CNO url was derived from
https://cache.nixos.org/iy72vcwvwd2inhsmqvpsi451fph85gzi.narinfo by
looking at the latest build results of wireshark from HNO for aarch64-darwin.
This commit is contained in:
Janik Haag
2026-04-27 23:16:04 +02:00
parent 521c09a80b
commit f30b55a46f
+4
View File
@@ -52,6 +52,7 @@
withQt ? true,
qt6,
libpcap' ? libpcap.override { withBluez = stdenv.hostPlatform.isLinux; },
withExtras ? stdenv.hostPlatform.isLinux,
}:
let
isAppBundle = withQt && stdenv.hostPlatform.isDarwin;
@@ -185,6 +186,9 @@ stdenv.mkDerivation (finalAttrs: {
postInstall = ''
cmake --install . --prefix "''${!outputDev}" --component Development
''
+ lib.optionalString withExtras ''
ln -s $out/libexec/wireshark/extcap/* -t $out/bin/
''
+ lib.optionalString isAppBundle ''
mkdir -p $out/Applications
mv $out/bin/Wireshark.app $out/Applications/Wireshark.app