2018-12-08 21:48:00 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.iotop;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
2024-04-17 14:37:58 +03:00
|
|
|
programs.iotop.enable = lib.mkEnableOption "iotop + setcap wrapper";
|
2018-12-08 21:48:00 +01:00
|
|
|
};
|
2024-04-17 14:37:58 +03:00
|
|
|
config = lib.mkIf cfg.enable {
|
2018-12-08 21:48:00 +01:00
|
|
|
security.wrappers.iotop = {
|
2021-09-12 18:53:48 +02:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
2018-12-08 21:48:00 +01:00
|
|
|
capabilities = "cap_net_admin+p";
|
2021-09-12 18:53:48 +02:00
|
|
|
source = "${pkgs.iotop}/bin/iotop";
|
2018-12-08 21:48:00 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|