about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2019-12-31 14:23:19 +0000
committerGitHub <noreply@github.com>2019-12-31 14:23:19 +0000
commita45447a3d5f79416438db78093e7b205ba5628dd (patch)
tree6dc1c21b5a08777a196bebd5fdf67822a0fbea12 /nixos
parent3238beab0a32b29eda2a63bf56e67df6e8a1f632 (diff)
parent1a477dc8954fb3e384e2f6f89d62904876f952d1 (diff)
downloadnixlib-a45447a3d5f79416438db78093e7b205ba5628dd.tar
nixlib-a45447a3d5f79416438db78093e7b205ba5628dd.tar.gz
nixlib-a45447a3d5f79416438db78093e7b205ba5628dd.tar.bz2
nixlib-a45447a3d5f79416438db78093e7b205ba5628dd.tar.lz
nixlib-a45447a3d5f79416438db78093e7b205ba5628dd.tar.xz
nixlib-a45447a3d5f79416438db78093e7b205ba5628dd.tar.zst
nixlib-a45447a3d5f79416438db78093e7b205ba5628dd.zip
bandwhich: init at 0.6.0 (#76689)
bandwhich: init at 0.6.0
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/bandwhich.nix29
2 files changed, 30 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 11bb900f7bb5..5b21aec51bdd 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -95,6 +95,7 @@
   ./programs/adb.nix
   ./programs/atop.nix
   ./programs/autojump.nix
+  ./programs/bandwhich.nix
   ./programs/bash/bash.nix
   ./programs/bcc.nix
   ./programs/browserpass.nix
diff --git a/nixos/modules/programs/bandwhich.nix b/nixos/modules/programs/bandwhich.nix
new file mode 100644
index 000000000000..5413044f4614
--- /dev/null
+++ b/nixos/modules/programs/bandwhich.nix
@@ -0,0 +1,29 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let cfg = config.programs.bandwhich;
+in {
+  meta.maintainers = with maintainers; [ filalex77 ];
+
+  options = {
+    programs.bandwhich = {
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Whether to add bandwhich to the global environment and configure a
+          setcap wrapper for it.
+        '';
+      };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    environment.systemPackages = with pkgs; [ bandwhich ];
+    security.wrappers.bandwhich = {
+      source = "${pkgs.bandwhich}/bin/bandwhich";
+      capabilities = "cap_net_raw,cap_net_admin+ep";
+    };
+  };
+}