move nixos modules to nixos-modules

This commit is contained in:
jopejoe1 2024-07-15 17:12:20 +02:00
parent 7394c5f317
commit 611796f02e
29 changed files with 225 additions and 7 deletions

View file

@ -0,0 +1,72 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.jopejoe1.audio;
in
{
options.jopejoe1.audio = {
enable = lib.mkEnableOption "Enable Audio";
sennheiser-hd-660s = lib.mkEnableOption "Equalizer for Sennheiser HD 660S";
};
config = lib.mkIf cfg.enable {
security.rtkit.enable = true;
services.pipewire = {
enable = true;
systemWide = false;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
extraConfig.pipewire."30-noise-filter" = {
"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;
};
};
}
];
};
};
};
imports = [ ./sennheiser-hd660s.nix ];
}

View file

@ -0,0 +1,191 @@
{ config, lib, ... }:
let
cfg = config.jopejoe1.audio;
in
{
config = lib.mkIf cfg.sennheiser-hd-660s {
services.pipewire = {
extraConfig.pipewire."20-Senheiser-HD660S" = {
"context.modules" = [
{
name = "libpipewire-module-filter-chain";
args = {
"node.description" = "Senheiser HD 660 S Equaliser";
"media.name" = "Senheiser HD 660 S Equaliser";
"filter.graph" = {
nodes = [
{
type = "builtin";
name = "eq_band_1";
label = "bq_highshelf";
control = {
"Freq" = 0.0;
"Q" = 1.0;
"Gain" = -6.4;
};
}
{
type = "builtin";
name = "eq_band_2";
label = "bq_lowshelf";
control = {
"Freq" = 105.0;
"Q" = 0.7;
"Gain" = 6.5;
};
}
{
type = "builtin";
name = "eq_band_3";
label = "bq_peaking";
control = {
"Freq" = 178.0;
"Q" = 0.49;
"Gain" = -3.2;
};
}
{
type = "builtin";
name = "eq_band_4";
label = "bq_peaking";
control = {
"Freq" = 1222.0;
"Q" = 2.34;
"Gain" = -2.3;
};
}
{
type = "builtin";
name = "eq_band_5";
label = "bq_peaking";
control = {
"Freq" = 5470.0;
"Q" = 4.4;
"Gain" = -7.3;
};
}
{
type = "builtin";
name = "eq_band_6";
label = "bq_peaking";
control = {
"Freq" = 7899.0;
"Q" = 0.68;
"Gain" = 6.5;
};
}
{
type = "builtin";
name = "eq_band_7";
label = "bq_peaking";
control = {
"Freq" = 784.0;
"Q" = 3.52;
"Gain" = -0.4;
};
}
{
type = "builtin";
name = "eq_band_8";
label = "bq_peaking";
control = {
"Freq" = 2250.0;
"Q" = 3.58;
"Gain" = 1.3;
};
}
{
type = "builtin";
name = "eq_band_9";
label = "bq_peaking";
control = {
"Freq" = 3380.0;
"Q" = 2.84;
"Gain" = -0.9;
};
}
{
type = "builtin";
name = "eq_band_10";
label = "bq_peaking";
control = {
"Freq" = 6701.0;
"Q" = 6.0;
"Gain" = 1.2;
};
}
{
type = "builtin";
name = "eq_band_11";
label = "bq_highshelf";
control = {
"Freq" = 10000.0;
"Q" = 0.7;
"Gain" = -1.1;
};
}
];
links = [
{
output = "eq_band_1:Out";
input = "eq_band_2:In";
}
{
output = "eq_band_2:Out";
input = "eq_band_3:In";
}
{
output = "eq_band_3:Out";
input = "eq_band_4:In";
}
{
output = "eq_band_4:Out";
input = "eq_band_5:In";
}
{
output = "eq_band_5:Out";
input = "eq_band_6:In";
}
{
output = "eq_band_6:Out";
input = "eq_band_7:In";
}
{
output = "eq_band_7:Out";
input = "eq_band_8:In";
}
{
output = "eq_band_8:Out";
input = "eq_band_9:In";
}
{
output = "eq_band_9:Out";
input = "eq_band_10:In";
}
{
output = "eq_band_10:Out";
input = "eq_band_11:In";
}
];
};
"audio.channels" = 2;
"audio.position" = [
"FL"
"FR"
];
"capture.props" = {
"node.name" = "effect_input.eq11";
"media.class" = "Audio/Sink";
};
"playback.props" = {
"node.name" = "effect_output.eq11";
"node.passive" = true;
};
};
}
];
};
};
};
}