2023-03-08 04:21:06 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.nexttrace;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
programs.nexttrace = {
|
|
|
|
enable = lib.mkEnableOption "Nexttrace to the global environment and configure a setcap wrapper for it";
|
2023-11-30 19:03:14 +01:00
|
|
|
package = lib.mkPackageOption pkgs "nexttrace" { };
|
2023-03-08 04:21:06 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
|
|
|
|
security.wrappers.nexttrace = {
|
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
|
|
|
capabilities = "cap_net_raw,cap_net_admin+eip";
|
|
|
|
source = "${cfg.package}/bin/nexttrace";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|