2024-11-18 16:34:47 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2020-01-17 21:25:34 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.traceroute;
|
2024-11-18 16:34:47 +01:00
|
|
|
in
|
|
|
|
{
|
2020-01-17 21:25:34 +00:00
|
|
|
options = {
|
|
|
|
programs.traceroute = {
|
2024-04-17 14:37:58 +03:00
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
2020-01-17 21:25:34 +00:00
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to configure a setcap wrapper for traceroute.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-17 14:37:58 +03:00
|
|
|
config = lib.mkIf cfg.enable {
|
2020-01-17 21:25:34 +00:00
|
|
|
security.wrappers.traceroute = {
|
2021-09-12 18:53:48 +02:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
2020-01-17 21:25:34 +00:00
|
|
|
capabilities = "cap_net_raw+p";
|
2024-11-18 16:28:45 +01:00
|
|
|
source = lib.getExe pkgs.traceroute;
|
2020-01-17 21:25:34 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|