summary refs log tree commit diff
path: root/nixos/modules/programs/traceroute.nix
diff options
context:
space:
mode:
authorvolth <volth@volth.com>2020-01-17 21:25:34 +0000
committervolth <volth@volth.com>2020-01-17 21:28:54 +0000
commitd5d1293fe35b92059f5671a5f27db0c00549bdb0 (patch)
tree7210e5b359fe16b9aed9b2f483aa086b086e1563 /nixos/modules/programs/traceroute.nix
parent8c7a5613f3bc14f3584d3db6bed342c6804203ef (diff)
downloadnixpkgs-d5d1293fe35b92059f5671a5f27db0c00549bdb0.tar
nixpkgs-d5d1293fe35b92059f5671a5f27db0c00549bdb0.tar.gz
nixpkgs-d5d1293fe35b92059f5671a5f27db0c00549bdb0.tar.bz2
nixpkgs-d5d1293fe35b92059f5671a5f27db0c00549bdb0.tar.lz
nixpkgs-d5d1293fe35b92059f5671a5f27db0c00549bdb0.tar.xz
nixpkgs-d5d1293fe35b92059f5671a5f27db0c00549bdb0.tar.zst
nixpkgs-d5d1293fe35b92059f5671a5f27db0c00549bdb0.zip
nixos/traceroute: init
Diffstat (limited to 'nixos/modules/programs/traceroute.nix')
-rw-r--r--nixos/modules/programs/traceroute.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixos/modules/programs/traceroute.nix b/nixos/modules/programs/traceroute.nix
new file mode 100644
index 00000000000..4eb0be3f0e0
--- /dev/null
+++ b/nixos/modules/programs/traceroute.nix
@@ -0,0 +1,26 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.programs.traceroute;
+in {
+  options = {
+    programs.traceroute = {
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Whether to configure a setcap wrapper for traceroute.
+        '';
+      };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    security.wrappers.traceroute = {
+      source = "${pkgs.traceroute}/bin/traceroute";
+      capabilities = "cap_net_raw+p";
+    };
+  };
+}