nix: make pulseaudio options version-dependent
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
6fa9b974ec
commit
370060f75e
1 changed files with 36 additions and 26 deletions
|
@ -8,35 +8,45 @@ with lib; let
|
||||||
in {
|
in {
|
||||||
options.custom.services.pipewire.enable = mkOption {default = false;};
|
options.custom.services.pipewire.enable = mkOption {default = false;};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable ({
|
||||||
#!! Realtime priority may cause desync
|
#!! Realtime priority may cause desync
|
||||||
#// security.rtkit.enable = true;
|
#// security.rtkit.enable = true;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
pulseaudio.enable = false;
|
# https://wiki.nixos.org/wiki/PipeWire
|
||||||
|
# https://gitlab.freedesktop.org/pipewire/pipewire
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
|
||||||
# https://wiki.nixos.org/wiki/PipeWire
|
alsa = {
|
||||||
# https://gitlab.freedesktop.org/pipewire/pipewire
|
enable = true;
|
||||||
pipewire = {
|
support32Bit = true;
|
||||||
enable = true;
|
};
|
||||||
alsa.enable = true;
|
|
||||||
alsa.support32Bit = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
|
|
||||||
# Avoid resampling if possible
|
# Avoid resampling if possible
|
||||||
# https://wiki.archlinux.org/title/PipeWire#Changing_the_allowed_sample_rate(s)
|
# https://wiki.archlinux.org/title/PipeWire#Changing_the_allowed_sample_rate(s)
|
||||||
extraConfig.pipewire = {
|
extraConfig.pipewire = {
|
||||||
"10-sample-rate"."context.properties"."default.clock.allowed-rates" = [
|
"10-sample-rate"."context.properties"."default.clock.allowed-rates" = [
|
||||||
32000
|
32000
|
||||||
44100
|
44100
|
||||||
48000
|
48000
|
||||||
88200
|
88200
|
||||||
96000
|
96000
|
||||||
176400
|
176400
|
||||||
192000
|
192000
|
||||||
];
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
};
|
// (
|
||||||
|
if versionAtLeast version "25.05"
|
||||||
|
then {
|
||||||
|
services.pulseaudio.enable = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hardware.pulseaudio.enable = false;
|
||||||
|
}
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue