7490e96e38
The `iotop` program can't be started by an unprivileged user because of missing root privileges. The issue can be fixed by creating a setcap wrapper for `iotop` which contains `cap_net_admin`.
18 lines
374 B
Nix
18 lines
374 B
Nix
{ 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";
|
|
};
|
|
};
|
|
}
|