mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
[Backport release-24.11] nixos/arp-scan: init, nixos/tcpdump: init (#357214)
This commit is contained in:
commit
f5e19b9e24
@ -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
|
||||
@ -296,6 +297,7 @@
|
||||
./programs/sysdig.nix
|
||||
./programs/system-config-printer.nix
|
||||
./programs/systemtap.nix
|
||||
./programs/tcpdump.nix
|
||||
./programs/thefuck.nix
|
||||
./programs/thunar.nix
|
||||
./programs/thunderbird.nix
|
||||
|
32
nixos/modules/programs/arp-scan.nix
Normal file
32
nixos/modules/programs/arp-scan.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
@ -1,10 +1,16 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.iftop;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.iftop.enable = lib.mkEnableOption "iftop + setcap wrapper";
|
||||
programs.iftop.enable = lib.mkEnableOption "iftop and setcap wrapper for it";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.iftop ];
|
||||
@ -12,7 +18,7 @@ in {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
capabilities = "cap_net_raw+p";
|
||||
source = "${pkgs.iftop}/bin/iftop";
|
||||
source = lib.getExe pkgs.iftop;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
36
nixos/modules/programs/tcpdump.nix
Normal file
36
nixos/modules/programs/tcpdump.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.tcpdump;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.tcpdump = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to configure a setcap wrapper for tcpdump.
|
||||
To use it, add your user to the `pcap` group.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
security.wrappers.tcpdump = {
|
||||
owner = "root";
|
||||
group = "pcap";
|
||||
capabilities = "cap_net_raw+p";
|
||||
permissions = "u+rx,g+x";
|
||||
source = lib.getExe pkgs.tcpdump;
|
||||
};
|
||||
|
||||
users.groups.pcap = { };
|
||||
};
|
||||
}
|
@ -1,8 +1,14 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.traceroute;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
programs.traceroute = {
|
||||
enable = lib.mkOption {
|
||||
@ -20,7 +26,7 @@ in {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
capabilities = "cap_net_raw+p";
|
||||
source = "${pkgs.traceroute}/bin/traceroute";
|
||||
source = lib.getExe pkgs.traceroute;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user