at 22.05-pre 416 B view raw
1{ config, pkgs, lib, ... }: 2 3with lib; 4 5let 6 cfg = config.programs.iftop; 7in { 8 options = { 9 programs.iftop.enable = mkEnableOption "iftop + setcap wrapper"; 10 }; 11 config = mkIf cfg.enable { 12 environment.systemPackages = [ pkgs.iftop ]; 13 security.wrappers.iftop = { 14 owner = "root"; 15 group = "root"; 16 capabilities = "cap_net_raw+p"; 17 source = "${pkgs.iftop}/bin/iftop"; 18 }; 19 }; 20}