summary refs log tree commit diff
path: root/nixos/modules/programs/noisetorch.nix
blob: 5f3b0c8f5d1eee0737f36b93ca857e992034ba1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ config, pkgs, lib, ... }:

with lib;

let cfg = config.programs.noisetorch;
in {
  options.programs.noisetorch = {
    enable = mkEnableOption "noisetorch + setcap wrapper";

    package = mkOption {
      type = types.package;
      default = pkgs.noisetorch;
      description = ''
        The noisetorch package to use.
      '';
    };
  };

  config = mkIf cfg.enable {
    security.wrappers.noisetorch = {
      source = "${cfg.package}/bin/noisetorch";
      capabilities = "cap_sys_resource=+ep";
    };
  };
}