1{ config, lib, pkgs, ... }:
2
3let
4 cfg = config.programs.wavemon;
5in {
6 options = {
7 programs.wavemon = {
8 enable = lib.mkOption {
9 type = lib.types.bool;
10 default = false;
11 description = ''
12 Whether to add wavemon to the global environment and configure a
13 setcap wrapper for it.
14 '';
15 };
16 };
17 };
18
19 config = lib.mkIf cfg.enable {
20 environment.systemPackages = with pkgs; [ wavemon ];
21 security.wrappers.wavemon = {
22 owner = "root";
23 group = "root";
24 capabilities = "cap_net_admin+ep";
25 source = "${pkgs.wavemon}/bin/wavemon";
26 };
27 };
28}