about summary refs log tree commit diff
path: root/nixos/modules/programs/iftop.nix
blob: d6e56c8fded6987e407b77a9fce250e599a4b568 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ config, pkgs, lib, ... }:

let
  cfg = config.programs.iftop;
in {
  options = {
    programs.iftop.enable = lib.mkEnableOption "iftop + setcap wrapper";
  };
  config = lib.mkIf cfg.enable {
    environment.systemPackages = [ pkgs.iftop ];
    security.wrappers.iftop = {
      owner = "root";
      group = "root";
      capabilities = "cap_net_raw+p";
      source = "${pkgs.iftop}/bin/iftop";
    };
  };
}