2021-05-20 23:08:51 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let cfg = config.programs.noisetorch;
|
2022-08-12 12:06:08 +00:00
|
|
|
in
|
|
|
|
{
|
2021-05-20 23:08:51 +00:00
|
|
|
options.programs.noisetorch = {
|
2024-04-21 15:54:59 +00:00
|
|
|
enable = mkEnableOption "noisetorch (+ setcap wrapper), a virtual microphone device with noise suppression";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
package = mkPackageOption pkgs "noisetorch" { };
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
security.wrappers.noisetorch = {
|
2021-09-22 15:38:15 +00:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
2021-05-20 23:08:51 +00:00
|
|
|
capabilities = "cap_sys_resource=+ep";
|
2021-09-22 15:38:15 +00:00
|
|
|
source = "${cfg.package}/bin/noisetorch";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
2022-08-12 12:06:08 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|