1
1
Fork 0

nix: make pulseaudio options version-dependent

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-01-10 16:01:00 -06:00
parent 6fa9b974ec
commit 370060f75e
Signed by: Myned
GPG key ID: C7224454F7881A34

View file

@ -8,21 +8,22 @@ with lib; let
in {
options.custom.services.pipewire.enable = mkOption {default = false;};
config = mkIf cfg.enable {
config = mkIf cfg.enable ({
#!! Realtime priority may cause desync
#// security.rtkit.enable = true;
services = {
pulseaudio.enable = false;
# https://wiki.nixos.org/wiki/PipeWire
# https://gitlab.freedesktop.org/pipewire/pipewire
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
# Avoid resampling if possible
# https://wiki.archlinux.org/title/PipeWire#Changing_the_allowed_sample_rate(s)
extraConfig.pipewire = {
@ -38,5 +39,14 @@ in {
};
};
};
};
}
// (
if versionAtLeast version "25.05"
then {
services.pulseaudio.enable = false;
}
else {
hardware.pulseaudio.enable = false;
}
));
}