2021-08-21 05:43:43 +03:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
cfg = config.programs.cnping;
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
options = {
|
|
|
|
|
programs.cnping = {
|
2024-04-17 14:37:58 +03:00
|
|
|
enable = lib.mkEnableOption "a setcap wrapper for cnping";
|
2021-08-21 05:43:43 +03:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-04-17 14:37:58 +03:00
|
|
|
config = lib.mkIf cfg.enable {
|
2021-08-21 05:43:43 +03:00
|
|
|
security.wrappers.cnping = {
|
|
|
|
|
source = "${pkgs.cnping}/bin/cnping";
|
|
|
|
|
capabilities = "cap_net_raw+ep";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|