diff --git a/hosts/micronix/config/pipewire/pipewire.nix b/hosts/micronix/config/pipewire/pipewire.nix new file mode 100644 index 0000000..f9d93d7 --- /dev/null +++ b/hosts/micronix/config/pipewire/pipewire.nix @@ -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; + } + ]; + } + ]; + }; + }; +} diff --git a/hosts/micronix/system.nix b/hosts/micronix/system.nix index bbeef4a..2024ffa 100644 --- a/hosts/micronix/system.nix +++ b/hosts/micronix/system.nix @@ -5,6 +5,7 @@ imports = [ ./config/sysctl.d/performance.nix ./config/sysctl.d/hardening.nix + ./config/pipewire/pipewire.nix ]; boot.kernelPackages = pkgs.linuxPackages_latest; @@ -143,13 +144,7 @@ xdg-desktop-portal-gtk xdg-desktop-portal-gnome ]; - config = { - common = { - default = [ - "gtk" - ]; - }; - }; + config.common.default = "*"; }; environment.sessionVariables.NIXOS_OZONE_WL = "1";