Add option to enable iotop with delayacct tracking in kernel (#363452)
This commit is contained in:
@@ -12,9 +12,15 @@ in
|
||||
options = {
|
||||
programs.iotop = {
|
||||
enable = lib.mkEnableOption "iotop + setcap wrapper";
|
||||
|
||||
package = lib.mkPackageOption pkgs "iotop" { example = "iotop-c"; };
|
||||
|
||||
enableDelayacct = lib.mkEnableOption ''
|
||||
the task_delayacct kernel task delay accounting in order to show all
|
||||
statistics'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
security.wrappers.iotop = {
|
||||
owner = "root";
|
||||
@@ -22,5 +28,7 @@ in
|
||||
capabilities = "cap_net_admin+p";
|
||||
source = lib.getExe cfg.package;
|
||||
};
|
||||
|
||||
boot.kernel.sysctl = lib.mkIf cfg.enableDelayacct { "kernel.task_delayacct" = 1; };
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user