diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 3ee242ab2226..04bcb41cd07a 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -101,6 +101,7 @@ ./programs/gnupg.nix ./programs/gphoto2.nix ./programs/iftop.nix + ./programs/iotop.nix ./programs/java.nix ./programs/kbdlight.nix ./programs/less.nix diff --git a/nixos/modules/programs/iotop.nix b/nixos/modules/programs/iotop.nix new file mode 100644 index 000000000000..986d562ad0f8 --- /dev/null +++ b/nixos/modules/programs/iotop.nix @@ -0,0 +1,18 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.programs.iotop; +in { + options = { + programs.iotop.enable = mkEnableOption "iotop + setcap wrapper"; + }; + config = mkIf cfg.enable { + environment.systemPackages = [ pkgs.iotop ]; + security.wrappers.iotop = { + source = "${pkgs.iotop}/bin/iotop"; + capabilities = "cap_net_admin+p"; + }; + }; +}