summary refs log tree commit diff
path: root/nixos/modules/programs/cnping.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/programs/cnping.nix')
-rw-r--r--nixos/modules/programs/cnping.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/nixos/modules/programs/cnping.nix b/nixos/modules/programs/cnping.nix
new file mode 100644
index 00000000000..d208d2b0704
--- /dev/null
+++ b/nixos/modules/programs/cnping.nix
@@ -0,0 +1,21 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.programs.cnping;
+in
+{
+  options = {
+    programs.cnping = {
+      enable = mkEnableOption "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";
+    };
+  };
+}