Do not install pavucontrol on non-graphical installs.
This commit is contained in:
parent
55654fafb1
commit
7c6afef2bb
@ -29,4 +29,5 @@
|
||||
me.graphics_card_type = "intel";
|
||||
me.kodi.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.sound.enable = true;
|
||||
}
|
||||
|
@ -49,5 +49,6 @@
|
||||
me.python.enable = true;
|
||||
me.qemu.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.sway.enable = true;
|
||||
}
|
||||
|
@ -8,69 +8,85 @@
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
pavucontrol
|
||||
];
|
||||
|
||||
# rtkit is optional but recommended
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
extraLv2Packages = [ pkgs.rnnoise-plugin ];
|
||||
configPackages = [
|
||||
(pkgs.writeTextDir "share/pipewire/pipewire.conf.d/99-input-denoising.conf" ''
|
||||
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
|
||||
# Optionally specify a specific input: (ID from `pactl list`)
|
||||
# target.object = "alsa_input.usb-Shure_Incorporated_Shure_Digital-00.analog-stereo"
|
||||
}
|
||||
playback.props = {
|
||||
node.name = "rnnoise_source"
|
||||
media.class = Audio/Source
|
||||
audio.rate = 48000
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
'')
|
||||
];
|
||||
};
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
directories = [
|
||||
".local/state/wireplumber" # Sound settings
|
||||
];
|
||||
options.me = {
|
||||
sound.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install sound.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.sound.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
# rtkit is optional but recommended
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
extraLv2Packages = [ pkgs.rnnoise-plugin ];
|
||||
configPackages = [
|
||||
(pkgs.writeTextDir "share/pipewire/pipewire.conf.d/99-input-denoising.conf" ''
|
||||
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
|
||||
# Optionally specify a specific input: (ID from `pactl list`)
|
||||
# target.object = "alsa_input.usb-Shure_Incorporated_Shure_Digital-00.analog-stereo"
|
||||
}
|
||||
playback.props = {
|
||||
node.name = "rnnoise_source"
|
||||
media.class = Audio/Source
|
||||
audio.rate = 48000
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
'')
|
||||
];
|
||||
};
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
directories = [
|
||||
".local/state/wireplumber" # Sound settings
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf config.me.graphical {
|
||||
environment.systemPackages = with pkgs; [
|
||||
pavucontrol
|
||||
];
|
||||
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user