2021-08-21 04:43:43 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.cnping;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
programs.cnping = {
|
2022-08-28 21:18:44 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "Whether to install a setcap wrapper for cnping");
|
2021-08-21 04:43:43 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
security.wrappers.cnping = {
|
|
|
|
source = "${pkgs.cnping}/bin/cnping";
|
|
|
|
capabilities = "cap_net_raw+ep";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|