Move sound stuff into its own profile

This commit is contained in:
Alexander Bantyev 2021-10-04 14:37:02 +03:00
parent 4d21625b47
commit 51f56fe96b
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
3 changed files with 61 additions and 59 deletions

View File

@ -27,63 +27,4 @@ with deviceSpecific; {
services.logind.extraConfig = "HandlePowerKey=suspend"; services.logind.extraConfig = "HandlePowerKey=suspend";
# sound.enable = true; # sound.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
config.pipewire-pulse = {
"context.modules" = [
{
"args" = { };
"flags" = [ "ifexists" "nofail" ];
"name" = "libpipewire-module-rtkit";
}
{ "name" = "libpipewire-module-protocol-native"; }
{ "name" = "libpipewire-module-client-node"; }
{ "name" = "libpipewire-module-adapter"; }
{ "name" = "libpipewire-module-metadata"; }
{
"args" = {
"server.address" = [ "unix:native" "tcp:4713" ];
"vm.overrides" = { "pulse.min.quantum" = "1024/48000"; };
};
"name" = "libpipewire-module-protocol-pulse";
}
];
"context.properties" = { };
"context.spa-libs" = {
"audio.convert.*" = "audioconvert/libspa-audioconvert";
"support.*" = "support/libspa-support";
};
"stream.properties" = { };
};
media-session.config.bluez-monitor = {
properties = {
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
"bluez5.mdbc-support" = true;
};
rules = [
{
actions = {
update-props = {
"bluez5.auto-connect" = [ "hsp_hs" "hfp_hf" "a2dp_sink" ];
"bluez5.hw-volume" =
[ "hsp_ag" "hfp_ag" "a2dp_source" "a2dp_sink" ];
};
};
matches = [{ "device.name" = "~bluez_card.*"; }];
}
{
actions = { update-props = { "node.pause-on-idle" = false; }; };
matches = [
{ "node.name" = "~bluez_input.*"; }
{ "node.name" = "~bluez_output.*"; }
];
}
];
};
};
} }

60
profiles/sound.nix Normal file
View File

@ -0,0 +1,60 @@
{ pkgs, config, lib, ... }: {
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
config.pipewire-pulse = {
"context.modules" = [
{
"args" = { };
"flags" = [ "ifexists" "nofail" ];
"name" = "libpipewire-module-rtkit";
}
{ "name" = "libpipewire-module-protocol-native"; }
{ "name" = "libpipewire-module-client-node"; }
{ "name" = "libpipewire-module-adapter"; }
{ "name" = "libpipewire-module-metadata"; }
{
"args" = {
"server.address" = [ "unix:native" "tcp:4713" ];
"vm.overrides" = { "pulse.min.quantum" = "1024/48000"; };
};
"name" = "libpipewire-module-protocol-pulse";
}
];
"context.properties" = { };
"context.spa-libs" = {
"audio.convert.*" = "audioconvert/libspa-audioconvert";
"support.*" = "support/libspa-support";
};
"stream.properties" = { };
};
media-session.config.bluez-monitor = {
properties = {
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
"bluez5.mdbc-support" = true;
};
rules = [
{
actions = {
update-props = {
"bluez5.auto-connect" = [ "hsp_hs" "hfp_hf" "a2dp_sink" ];
"bluez5.hw-volume" =
[ "hsp_ag" "hfp_ag" "a2dp_source" "a2dp_sink" ];
};
};
matches = [{ "device.name" = "~bluez_card.*"; }];
}
{
actions = { update-props = { "node.pause-on-idle" = false; }; };
matches = [
{ "node.name" = "~bluez_input.*"; }
{ "node.name" = "~bluez_output.*"; }
];
}
];
};
};
}

View File

@ -10,6 +10,7 @@
# PROFILES # PROFILES
applications-setup applications-setup
hardware hardware
sound
virtualisation virtualisation
alacritty alacritty