2018-12-08 20:48:00 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.iotop;
|
|
|
|
in {
|
|
|
|
options = {
|
2022-08-28 20:18:44 +01:00
|
|
|
programs.iotop.enable = mkEnableOption (lib.mdDoc "iotop + setcap wrapper");
|
2018-12-08 20:48:00 +00:00
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
security.wrappers.iotop = {
|
2021-09-12 17:53:48 +01:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
2018-12-08 20:48:00 +00:00
|
|
|
capabilities = "cap_net_admin+p";
|
2021-09-12 17:53:48 +01:00
|
|
|
source = "${pkgs.iotop}/bin/iotop";
|
2018-12-08 20:48:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|