nix-conf/modules/audio/default.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

2023-08-09 21:38:49 +02:00
{ pkgs, ... }:
2023-12-17 15:25:49 +01:00
2023-05-19 20:53:02 +02:00
{
security.rtkit.enable = true;
services.pipewire = {
enable = true;
2023-12-19 20:00:17 +01:00
systemWide = true;
2023-05-19 20:53:02 +02:00
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
2023-12-17 15:25:49 +01:00
extraConfig.pipewire.nixos = {
"context.modules" = [{
name = "libpipewire-module-filter-chain";
args = {
"node.description" = "Noise Canceling source";
"media.name" = "Noise Canceling source";
"filter.graph" = {
nodes = [{
type = "ladspa";
name = "rnnoise";
plugin = "${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so";
label = "noise_suppressor_mono";
control = {
"VAD Threshold (%)" = 50.0;
"VAD Grace Period (ms)" = 200;
"Retroactive VAD Grace (ms)" = 0;
};
}];
};
"capture.props" = {
"node.name" = "capture.rnnoise_source";
"node.passive" = true;
"audio.rate" = 48000;
};
"playback.props" = {
"node.name" = "rnnoise_source";
"media.class" = "Audio/Source";
"audio.rate" = 48000;
};
};
}];
};
2023-05-19 20:53:02 +02:00
};
hardware.pulseaudio.enable = false;
}