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

with lib;

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