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