From 5efd5be3ecd30d9617e4ee8fe2b05c37a5493534 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Thu, 10 Aug 2023 11:41:23 +0200 Subject: [PATCH] Add pipewire config to home manager --- modules/users/jopejoe1/home.nix | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/modules/users/jopejoe1/home.nix b/modules/users/jopejoe1/home.nix index 6d0149c..c264f48 100644 --- a/modules/users/jopejoe1/home.nix +++ b/modules/users/jopejoe1/home.nix @@ -47,6 +47,43 @@ in { templates = "${hcfg.home.homeDirectory}/Templates"; videos = "${hcfg.home.homeDirectory}/Videos"; }; + configFile = { + "pipewire/pipewire.conf.d/rnnoise.conf".text = '' + 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 + } + } +} +] + ''; + }; }; programs = { home-manager.enable = true;