2025-12-03 15:51:00 +00:00
|
|
|
# audio.nix
|
|
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
{
|
2026-01-10 19:41:41 +00:00
|
|
|
# Enable sound with pipewire.
|
|
|
|
|
services.pulseaudio.enable = false;
|
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
services.pipewire = {
|
|
|
|
|
enable = true;
|
|
|
|
|
alsa.enable = true;
|
|
|
|
|
alsa.support32Bit = true;
|
|
|
|
|
pulse.enable = true;
|
2026-01-10 19:45:37 +00:00
|
|
|
jack.enable = true;
|
|
|
|
|
|
|
|
|
|
# Enable audio monitoring for game capture
|
|
|
|
|
extraConfig.pipewire."92-low-latency" = {
|
|
|
|
|
context.properties = {
|
|
|
|
|
default.clock.rate = 48000;
|
|
|
|
|
default.clock.quantum = 1024;
|
|
|
|
|
default.clock.min-quantum = 512;
|
|
|
|
|
default.clock.max-quantum = 2048;
|
|
|
|
|
};
|
|
|
|
|
};
|
2026-01-10 19:46:25 +00:00
|
|
|
|
|
|
|
|
# Allow capturing audio from all applications including Steam games
|
|
|
|
|
extraConfig.pipewire."99-steam-monitor" = {
|
|
|
|
|
context.modules = [
|
|
|
|
|
{
|
|
|
|
|
name = "libpipewire-module-loopback";
|
|
|
|
|
args = {
|
|
|
|
|
node.description = "Steam Audio Monitor";
|
|
|
|
|
capture.props = {
|
|
|
|
|
media.class = "Audio/Sink";
|
|
|
|
|
audio.position = [ "FL" "FR" ];
|
|
|
|
|
};
|
|
|
|
|
playback.props = {
|
|
|
|
|
media.class = "Audio/Source";
|
|
|
|
|
audio.position = [ "FL" "FR" ];
|
|
|
|
|
};
|
|
|
|
|
};
|
2026-01-10 19:45:37 +00:00
|
|
|
}
|
2026-01-10 19:46:25 +00:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
2025-12-03 15:51:00 +00:00
|
|
|
}
|