···288288 kresd = 270;
289289 rpc = 271;
290290 geoip = 272;
291291- #wireshark = 273; # unused
292291293292 # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
294293···546545 kresd = 270;
547546 #rpc = 271; # unused
548547 #geoip = 272; # unused
549549- wireshark = 273;
550548551549 # When adding a gid, make sure it doesn't match an existing
552550 # uid. Users and groups with the same name should have equal
+5-20
nixos/modules/programs/wireshark.nix
···33with lib;
4455let
66-76 cfg = config.programs.wireshark;
87 wireshark = cfg.package;
99-1010-in
1111-1212-{
1313-88+in {
149 options = {
1515-1610 programs.wireshark = {
1717-1811 enable = mkOption {
1912 type = types.bool;
2013 default = false;
2114 description = ''
2215 Whether to add Wireshark to the global environment and configure a
2323- setuid wrapper for 'dumpcap' for users in the 'wireshark' group.
1616+ setcap wrapper for 'dumpcap' for users in the 'wireshark' group.
2417 '';
2518 };
2626-2719 package = mkOption {
2820 type = types.package;
2921 default = pkgs.wireshark-cli;
···3224 Which Wireshark package to install in the global environment.
3325 '';
3426 };
3535-3627 };
3737-3828 };
39294030 config = mkIf cfg.enable {
4141-4231 environment.systemPackages = [ wireshark ];
4343-3232+ users.extraGroups.wireshark = {};
3333+4434 security.wrappers.dumpcap = {
4535 source = "${wireshark}/bin/dumpcap";
3636+ capabilities = "cap_net_raw+p";
4637 owner = "root";
4738 group = "wireshark";
4848- setuid = true;
4949- setgid = false;
5039 permissions = "u+rx,g+x";
5140 };
5252-5353- users.extraGroups.wireshark.gid = config.ids.gids.wireshark;
5454-5541 };
5656-5742}