redo pipewire module

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-04-02 15:10:09 +03:00
parent 435b741506
commit 81ff294468
6 changed files with 55 additions and 17 deletions

View File

@ -1,21 +1,59 @@
{
config,
lib,
config,
...
}: {
security.rtkit.enable = lib.mkDefault config.services.pipewire.enable;
services = {
pulseaudio.enable = false;
pipewire = {
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.sound.pipewire;
in {
options = {
sound.pipewire.enable = mkEnableOption "enable pipewire";
};
config = mkIf cfg.enable {
security.rtkit.enable = true;
services.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
extraConfig.pipewire."92-low-latency" = {
context.properties.default.clock = {
rate = 48000;
quantum = 32;
min-quantum = 32;
max-quantum = 32;
extraConfig = {
pipewire = {
"92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [
44100
48000
88200
96000
];
"default.clock.min-quantum" = 512;
"default.clock.quantum" = 4096;
"default.clock.max-quantum" = 8192;
};
};
"93-no-resampling" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [
44100
48000
96000
192000
];
};
};
"94-no-upmixing" = {
"stream.properties" = {
"channelmix.upmix" = false;
};
};
};
};
};