about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/programs/cnping.nix
blob: d3cf659d4297f618532ee45ab07b9410bfccaaec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.programs.cnping;
in
{
  options = {
    programs.cnping = {
      enable = mkEnableOption (lib.mdDoc "Whether to install a setcap wrapper for cnping");
    };
  };

  config = mkIf cfg.enable {
    security.wrappers.cnping = {
      source = "${pkgs.cnping}/bin/cnping";
      capabilities = "cap_net_raw+ep";
    };
  };
}