diff options
author | 0x4A6F <0x4A6F@users.noreply.github.com> | 2021-03-07 11:38:12 +0100 |
---|---|---|
committer | 0x4A6F <0x4A6F@users.noreply.github.com> | 2022-04-09 16:50:13 +0200 |
commit | c57232d31cccfee6444bdd9dcddad95f816f85f2 (patch) | |
tree | a0f69ec5d4e5f1758f635f3b6ee39cbf2bfd1e8b /nixos | |
parent | ce56f53d3272901bb96972239bc254df5b56c703 (diff) |
programs/nethoscope: add security.wrapper
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/nethoscope.nix | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index c11497e46f10f..329c8685c36d7 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -185,6 +185,7 @@ ./programs/nbd.nix ./programs/nix-ld.nix ./programs/neovim.nix + ./programs/nethoscope.nix ./programs/nm-applet.nix ./programs/nncp.nix ./programs/npm.nix diff --git a/nixos/modules/programs/nethoscope.nix b/nixos/modules/programs/nethoscope.nix new file mode 100644 index 0000000000000..495548e9c6561 --- /dev/null +++ b/nixos/modules/programs/nethoscope.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let cfg = config.programs.nethoscope; +in +{ + meta.maintainers = with maintainers; [ _0x4A6F ]; + + options = { + programs.nethoscope = { + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether to add nethoscope to the global environment and configure a + setcap wrapper for it. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ nethoscope ]; + security.wrappers.nethoscope = { + source = "${pkgs.nethoscope}/bin/nethoscope"; + capabilities = "cap_net_raw,cap_net_admin=eip"; + }; + }; +} |