1{ config, pkgs, lib, ... }:
2
3with lib;
4
5let cfg = config.programs.noisetorch;
6in {
7 options.programs.noisetorch = {
8 enable = mkEnableOption "noisetorch + setcap wrapper";
9
10 package = mkOption {
11 type = types.package;
12 default = pkgs.noisetorch;
13 defaultText = literalExpression "pkgs.noisetorch";
14 description = ''
15 The noisetorch package to use.
16 '';
17 };
18 };
19
20 config = mkIf cfg.enable {
21 security.wrappers.noisetorch = {
22 owner = "root";
23 group = "root";
24 capabilities = "cap_sys_resource=+ep";
25 source = "${cfg.package}/bin/noisetorch";
26 };
27 };
28}