nix-conf/modules/audio/default.nix

73 lines
1.8 KiB
Nix
Raw Normal View History

2024-07-10 23:02:54 +02:00
{
config,
lib,
pkgs,
...
}:
2023-12-17 15:25:49 +01:00
2024-07-10 23:02:54 +02:00
let
cfg = config.jopejoe1.audio;
in
{
2023-12-29 16:43:40 +01:00
options.jopejoe1.audio = {
enable = lib.mkEnableOption "Enable Audio";
sennheiser-hd-660s = lib.mkEnableOption "Equalizer for Sennheiser HD 660S";
};
2023-12-20 19:22:50 +01:00
2023-12-29 16:43:40 +01:00
config = lib.mkIf cfg.enable {
security.rtkit.enable = true;
2023-05-19 20:53:02 +02:00
2023-12-29 16:43:40 +01:00
services.pipewire = {
2023-05-19 20:53:02 +02:00
enable = true;
2024-01-30 14:32:32 +01:00
systemWide = false;
2023-12-29 16:43:40 +01:00
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
2023-05-19 20:53:02 +02:00
2023-12-29 16:43:40 +01:00
wireplumber.enable = true;
2023-12-17 15:25:49 +01:00
2023-12-29 16:43:40 +01:00
extraConfig.pipewire."30-noise-filter" = {
2024-07-10 23:02:54 +02:00
"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)" = 0;
"Retroactive VAD Grace (ms)" = 50;
};
}
];
};
"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-12-29 16:43:40 +01:00
};
2024-07-10 23:02:54 +02:00
}
];
2023-12-29 16:43:40 +01:00
};
2023-12-17 15:25:49 +01:00
};
2023-05-19 20:53:02 +02:00
};
2023-12-29 16:43:40 +01:00
imports = [ ./sennheiser-hd660s.nix ];
2023-05-19 20:53:02 +02:00
}