Pipewire
This commit is contained in:
parent
f60ce1470b
commit
a894916b64
2 changed files with 135 additions and 7 deletions
133
hosts/micronix/config/pipewire/pipewire.nix
Normal file
133
hosts/micronix/config/pipewire/pipewire.nix
Normal file
|
@ -0,0 +1,133 @@
|
||||||
|
{...}: {
|
||||||
|
services.pipewire.extraConfig.pipewire = {
|
||||||
|
"context" = {
|
||||||
|
"properties" = {
|
||||||
|
"library.name.system" = "support/libspa-support";
|
||||||
|
"context.data-loop.library.name.system" = "support/libspa-support";
|
||||||
|
"support.dbus" = true;
|
||||||
|
"link.max-buffers" = 64;
|
||||||
|
"mem.allow-mlock" = true;
|
||||||
|
"mem.mlock-all" = true;
|
||||||
|
"clock.power-of-two-quantum" = true;
|
||||||
|
"cpu.zero.denormals" = true;
|
||||||
|
"loop.rt-prio" = -1;
|
||||||
|
"loop.class" = "data.rt";
|
||||||
|
"context.num-data-loops" = 1;
|
||||||
|
"context.data-loops" = [
|
||||||
|
{
|
||||||
|
"loop.rt-prio" = -1;
|
||||||
|
"loop.class" = ["data.rt" "audio.rt"];
|
||||||
|
"library.name.system" = "support/libspa-support";
|
||||||
|
"thread.name" = "data-loop.0";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
"core.daemon" = true;
|
||||||
|
"core.name" = "pipewire-0";
|
||||||
|
"default.clock.rate" = 48000;
|
||||||
|
"default.clock.allowed-rates" = [48000];
|
||||||
|
"module.x11.bell" = true;
|
||||||
|
"module.access" = true;
|
||||||
|
"module.jackdbus-detect" = true;
|
||||||
|
};
|
||||||
|
"properties.rules" = [
|
||||||
|
{
|
||||||
|
"matches" = [
|
||||||
|
{
|
||||||
|
"cpu.vm.name" = "!null";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
"actions" = {
|
||||||
|
"update-props" = {
|
||||||
|
"default.clock.min-quantum" = 1024;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
"spa-libs" = {
|
||||||
|
"audio.convert.*" = "audioconvert/libspa-audioconvert";
|
||||||
|
"avb.*" = "avb/libspa-avb";
|
||||||
|
"api.alsa.*" = "alsa/libspa-alsa";
|
||||||
|
"api.v4l2.*" = "v4l2/libspa-v4l2";
|
||||||
|
"api.libcamera.*" = "libcamera/libspa-libcamera";
|
||||||
|
"api.bluez5.*" = "bluez5/libspa-bluez5";
|
||||||
|
"api.vulkan.*" = "vulkan/libspa-vulkan";
|
||||||
|
"api.jack.*" = "jack/libspa-jack";
|
||||||
|
"support.*" = "support/libspa-support";
|
||||||
|
"video.convert.*" = "videoconvert/libspa-videoconvert";
|
||||||
|
};
|
||||||
|
"modules" = [
|
||||||
|
{
|
||||||
|
"name" = "libpipewire-module-rt";
|
||||||
|
"args" = {
|
||||||
|
"nice.level" = -11;
|
||||||
|
"rt.prio" = 80;
|
||||||
|
"rt.time.soft" = -1;
|
||||||
|
"rt.time.hard" = -1;
|
||||||
|
"uclamp.min" = 0;
|
||||||
|
"uclamp.max" = 1024;
|
||||||
|
};
|
||||||
|
"flags" = ["ifexists" "nofail"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"name" = "libpipewire-module-protocol-native";
|
||||||
|
"args" = {
|
||||||
|
"sockets" = [
|
||||||
|
{
|
||||||
|
"name" = "pipewire-0";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"name" = "pipewire-0-manager";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"name" = "libpipewire-module-portal";
|
||||||
|
"flags" = ["ifexists" "nofail"];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"name" = "libpipewire-module-access";
|
||||||
|
"args" = {
|
||||||
|
"access.socket" = {
|
||||||
|
"pipewire-0" = "default";
|
||||||
|
"pipewire-0-manager" = "unrestricted";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"condition" = [
|
||||||
|
{
|
||||||
|
"module.access" = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"name" = "libpipewire-module-x11-bell";
|
||||||
|
"args" = {
|
||||||
|
"sink.name" = "@DEFAULT_SINK@";
|
||||||
|
"sample.name" = "bell-window-system";
|
||||||
|
"x11.display" = null;
|
||||||
|
"x11.xauthority" = null;
|
||||||
|
};
|
||||||
|
"flags" = ["ifexists" "nofail"];
|
||||||
|
"condition" = [
|
||||||
|
{
|
||||||
|
"module.x11.bell" = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
"name" = "libpipewire-module-jackdbus-detect";
|
||||||
|
"args" = {
|
||||||
|
"source.props" = {};
|
||||||
|
"sink.props" = {};
|
||||||
|
};
|
||||||
|
"flags" = ["ifexists" "nofail"];
|
||||||
|
"condition" = [
|
||||||
|
{
|
||||||
|
"module.jackdbus-detect" = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./config/sysctl.d/performance.nix
|
./config/sysctl.d/performance.nix
|
||||||
./config/sysctl.d/hardening.nix
|
./config/sysctl.d/hardening.nix
|
||||||
|
./config/pipewire/pipewire.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
@ -143,13 +144,7 @@
|
||||||
xdg-desktop-portal-gtk
|
xdg-desktop-portal-gtk
|
||||||
xdg-desktop-portal-gnome
|
xdg-desktop-portal-gnome
|
||||||
];
|
];
|
||||||
config = {
|
config.common.default = "*";
|
||||||
common = {
|
|
||||||
default = [
|
|
||||||
"gtk"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue