8ac5e011d6
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
22 lines
470 B
Nix
22 lines
470 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.liboping;
|
|
in {
|
|
options.programs.liboping = {
|
|
enable = mkEnableOption "liboping";
|
|
};
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = with pkgs; [ liboping ];
|
|
security.wrappers = mkMerge (map (
|
|
exec: {
|
|
"${exec}" = {
|
|
source = "${pkgs.liboping}/bin/${exec}";
|
|
capabilities = "cap_net_raw+p";
|
|
};
|
|
}
|
|
) [ "oping" "noping" ]);
|
|
};
|
|
}
|