1{ config, lib, pkgs, ... }:
2
3let
4 cfg = config.programs.nexttrace;
5
6in
7{
8 options = {
9 programs.nexttrace = {
10 enable = lib.mkEnableOption "Nexttrace to the global environment and configure a setcap wrapper for it";
11 package = lib.mkPackageOption pkgs "nexttrace" { };
12 };
13 };
14
15 config = lib.mkIf cfg.enable {
16 environment.systemPackages = [ cfg.package ];
17
18 security.wrappers.nexttrace = {
19 owner = "root";
20 group = "root";
21 capabilities = "cap_net_raw,cap_net_admin+eip";
22 source = "${cfg.package}/bin/nexttrace";
23 };
24 };
25}