2021-02-22 17:02:35 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
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 = {
|
2024-04-17 11:37:58 +00:00
|
|
|
enable = lib.mkEnableOption "noisetorch (+ setcap wrapper), a virtual microphone device with noise suppression";
|
2021-02-22 17:02:35 +00:00
|
|
|
|
2024-04-17 11:37:58 +00:00
|
|
|
package = lib.mkPackageOption pkgs "noisetorch" { };
|
2021-02-22 17:02:35 +00:00
|
|
|
};
|
|
|
|
|
2024-04-17 11:37:58 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2021-02-22 17:02:35 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|