From 28291813168bbcad28f5f695c84b9d3ae470c69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 18 Nov 2024 16:27:52 +0100 Subject: [PATCH] nixos/arp-scan: init --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/arp-scan.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 nixos/modules/programs/arp-scan.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 67545614bdaa..fcb51891428b 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -148,6 +148,7 @@ ./programs/alvr.nix ./programs/appgate-sdp.nix ./programs/appimage.nix + ./programs/arp-scan.nix ./programs/atop.nix ./programs/ausweisapp.nix ./programs/autojump.nix diff --git a/nixos/modules/programs/arp-scan.nix b/nixos/modules/programs/arp-scan.nix new file mode 100644 index 000000000000..09775670b973 --- /dev/null +++ b/nixos/modules/programs/arp-scan.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.arp-scan; +in { + options = { + programs.arp-scan = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to configure a setcap wrapper for arp-scan. + ''; + }; + }; + }; + + config = lib.mkIf cfg.enable { + security.wrappers.arp-scan = { + owner = "root"; + group = "root"; + capabilities = "cap_net_raw+p"; + source = lib.getExe pkgs.arp-scan; + }; + }; +}