mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
102 lines
3 KiB
Nix
102 lines
3 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
sound = {
|
|
enable = true;
|
|
extraConfig = ''
|
|
defaults.pcm.rate_converter "speexrate_best"
|
|
'';
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [ pulsemixer ];
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
services.pipewire = {
|
|
enable = true;
|
|
config = {
|
|
pipewire = {
|
|
"context.properties" = {
|
|
"link.max-buffers" = 16;
|
|
"log.level" = 2;
|
|
"default.clock.rate" = 48000;
|
|
"default.clock.quantum" = 32;
|
|
"default.clock.min-quantum" = 32;
|
|
"default.clock.max-quantum" = 32;
|
|
"core.daemon" = true;
|
|
"core.name" = "pipewire-0";
|
|
};
|
|
"context.modules" = [
|
|
{
|
|
name = "libpipewire-module-rtkit";
|
|
args = {
|
|
"nice.level" = -15;
|
|
"rt.prio" = 88;
|
|
"rt.time.soft" = 200000;
|
|
"rt.time.hard" = 200000;
|
|
};
|
|
flags = [ "ifexists" "nofail" ];
|
|
}
|
|
{ name = "libpipewire-module-protocol-native"; }
|
|
{ name = "libpipewire-module-profiler"; }
|
|
{ name = "libpipewire-module-metadata"; }
|
|
{ name = "libpipewire-module-spa-device-factory"; }
|
|
{ name = "libpipewire-module-spa-node-factory"; }
|
|
{ name = "libpipewire-module-client-node"; }
|
|
{ name = "libpipewire-module-client-device"; }
|
|
{
|
|
name = "libpipewire-module-portal";
|
|
flags = [ "ifexists" "nofail" ];
|
|
}
|
|
{
|
|
name = "libpipewire-module-access";
|
|
args = {};
|
|
}
|
|
{ name = "libpipewire-module-adapter"; }
|
|
{ name = "libpipewire-module-link-factory"; }
|
|
{ name = "libpipewire-module-session-manager"; }
|
|
];
|
|
};
|
|
pipewire-pulse = {
|
|
"context.properties" = {
|
|
"log.level" = 2;
|
|
};
|
|
"context.modules" = [
|
|
{
|
|
name = "libpipewire-module-rtkit";
|
|
args = {
|
|
"nice.level" = -15;
|
|
"rt.prio" = 88;
|
|
"rt.time.soft" = 200000;
|
|
"rt.time.hard" = 200000;
|
|
};
|
|
flags = [ "ifexists" "nofail" ];
|
|
}
|
|
{ name = "libpipewire-module-protocol-native"; }
|
|
{ name = "libpipewire-module-client-node"; }
|
|
{ name = "libpipewire-module-adapter"; }
|
|
{ name = "libpipewire-module-metadata"; }
|
|
{
|
|
name = "libpipewire-module-protocol-pulse";
|
|
args = {
|
|
"pulse.min.req" = "32/48000";
|
|
"pulse.default.req" = "32/48000";
|
|
"pulse.max.req" = "32/48000";
|
|
"pulse.min.quantum" = "32/48000";
|
|
"pulse.max.quantum" = "32/48000";
|
|
"server.address" = [ "unix:native" ];
|
|
};
|
|
}
|
|
];
|
|
"stream.properties" = {
|
|
"node.latency" = "32/48000";
|
|
"resample.quality" = 1;
|
|
};
|
|
};
|
|
};
|
|
pulse.enable = true;
|
|
alsa.support32Bit = true;
|
|
jack.enable = true;
|
|
alsa.enable = true;
|
|
};
|
|
}
|