1 { config, lib, pkgs, ... }:
4 cfg = config.programs.wireshark;
5 wireshark = cfg.package;
9 enable = lib.mkOption {
10 type = lib.types.bool;
13 Whether to add Wireshark to the global environment and configure a
14 setcap wrapper for 'dumpcap' for users in the 'wireshark' group.
17 package = lib.mkPackageOption pkgs "wireshark-cli" {
18 example = "wireshark";
23 config = lib.mkIf cfg.enable {
24 environment.systemPackages = [ wireshark ];
25 users.groups.wireshark = {};
27 security.wrappers.dumpcap = {
28 source = "${wireshark}/bin/dumpcap";
29 capabilities = "cap_net_raw,cap_net_admin+eip";
32 permissions = "u+rx,g+x";