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 = {
|
|
|
|
enable = mkEnableOption (lib.mdDoc "noisetorch + setcap wrapper");
|
|
|
|
|
2023-11-27 01:19:27 +01:00
|
|
|
package = mkPackageOption pkgs "noisetorch" { };
|
2021-02-22 18:02:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|