summary refs log tree commit diff
path: root/nixos/modules/programs/iftop.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/programs/iftop.nix')
-rw-r--r--nixos/modules/programs/iftop.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/nixos/modules/programs/iftop.nix b/nixos/modules/programs/iftop.nix
new file mode 100644
index 00000000000..c74714a9a6d
--- /dev/null
+++ b/nixos/modules/programs/iftop.nix
@@ -0,0 +1,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";
+    };
+  };
+}