2021-02-22 18:02:35 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let cfg = config.programs.noisetorch;
|
2022-07-30 20:59:31 +02:00
|
|
|
in
|
|
|
|
{
|
2021-02-22 18:02:35 +01:00
|
|
|
options.programs.noisetorch = {
|
2022-08-28 21:18:44 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "noisetorch + setcap wrapper");
|
2021-02-22 18:02:35 +01:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.noisetorch;
|
2021-10-03 18:06:03 +02:00
|
|
|
defaultText = literalExpression "pkgs.noisetorch";
|
2022-07-28 23:19:15 +02:00
|
|
|
description = lib.mdDoc ''
|
2021-02-22 18:02:35 +01:00
|
|
|
The noisetorch package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
security.wrappers.noisetorch = {
|
2021-09-12 18:53:48 +02:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
2021-02-22 18:02:35 +01:00
|
|
|
capabilities = "cap_sys_resource=+ep";
|
2021-09-12 18:53:48 +02:00
|
|
|
source = "${cfg.package}/bin/noisetorch";
|
2021-02-22 18:02:35 +01:00
|
|
|
};
|
2022-07-30 20:59:31 +02:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2021-02-22 18:02:35 +01:00
|
|
|
};
|
|
|
|
}
|