2024-11-18 15:34:47 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2018-04-07 13:06:51 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.iftop;
|
2024-11-18 15:34:47 +00:00
|
|
|
in
|
|
|
|
{
|
2018-04-07 13:06:51 +00:00
|
|
|
options = {
|
2024-11-18 15:28:30 +00:00
|
|
|
programs.iftop.enable = lib.mkEnableOption "iftop and setcap wrapper for it";
|
2018-04-07 13:06:51 +00:00
|
|
|
};
|
2024-04-17 11:37:58 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2018-04-07 13:06:51 +00:00
|
|
|
environment.systemPackages = [ pkgs.iftop ];
|
|
|
|
security.wrappers.iftop = {
|
2021-09-12 16:53:48 +00:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
2018-04-07 13:06:51 +00:00
|
|
|
capabilities = "cap_net_raw+p";
|
2024-11-18 15:28:30 +00:00
|
|
|
source = lib.getExe pkgs.iftop;
|
2018-04-07 13:06:51 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|