Switch pulsebert to pipewire 🎉

This commit is contained in:
Sandro - 2022-09-25 19:47:58 +02:00
parent e44b17b4c4
commit d5507357ec
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
5 changed files with 100 additions and 77 deletions

View File

@ -16,7 +16,7 @@
};
hardware.pulseaudio = {
enable = true;
enable = !config.services.pipewire.pulse.enable;
systemWide = true;
tcp = {
enable = true;
@ -41,14 +41,38 @@
});
};
# pipewire has no systemwide pipewire-pulse
# services.pipewire = {
# enable = true;
# config.pipewire-pulse = lib.importJSON ./pipewire-pulse.conf.json;
# pulse.enable = true;
# socketActivation = false;
# systemWide = true;
# };
services.pipewire = {
enable = true;
# config.pipewire-pulse = lib.importJSON ./pipewire-pulse.conf.json;
config.pipewire-pulse =
let
default-pipewire-pulse = lib.importJSON (pkgs.path + "/nixos/modules/services/desktops/pipewire/daemon/pipewire-pulse.conf.json");
in
default-pipewire-pulse // {
"context.exec" = default-pipewire-pulse."context.exec" ++ [
{
"path" = "pactl";
"args" = "load-module module-zeroconf-publish";
}
];
"pulse.properties" = {
"auth-ip-acl" = [
"127.0.0.0/8"
"::1/128"
"fd23:42:c3d2:500::/56"
"172.22.99.0/24"
"172.20.72.0/21"
"2a00:8180:2c00:200::/56"
"2a0f:5382:acab:1400::/56"
];
"server.address" = [
"unix:native"
"tcp:4713"
];
};
};
pulse.enable = true;
};
security.rtkit.enable = true;
@ -62,6 +86,13 @@
};
};
system.activationScripts.enableLingering = lib.optionalString config.services.pipewire.pulse.enable (''
rm -r /var/lib/systemd/linger
mkdir /var/lib/systemd/linger
'' + lib.optionalString config.c3d2.k-ot.enable ''
touch /var/lib/systemd/linger/k-ot
'');
systemd.services.bluetooth-agent = lib.mkIf config.hardware.bluetooth.enable {
description = "Allow anyone to pair via Bluetooth";
wantedBy = [ "multi-user.target" ];

View File

@ -1,32 +1,30 @@
{
"context.modules": [
"context.exec": [
{
"name": "libpipewire-module-zeroconf-publish"
},
{
"name": "libpipewire-module-protocol-pulse",
"args": {
"auth-ip-acl": [
"127.0.0.0/8",
"::1/128",
"fd23:42:c3d2:500::/56",
"172.22.99.0/24",
"172.20.72.0/21",
"2a00:8180:2c00:200::/56",
"2a0f:5382:acab:1400::/56"
],
"server.address": [
"unix:native",
"tcp:4713"
],
"pulse.min.req": "256/48000",
"pulse.default.req": "960/48000",
"pulse.min.frag": "256/48000",
"pulse.default.frag": "96000/48000",
"pulse.default.tlength": "96000/48000",
"pulse.min.quantum": "256/48000",
"pulse.default.format": "F32"
}
"path": "pactl",
"args": "load-module module-zeroconf-publish"
}
]
],
"pulse.properties": {
"auth-ip-acl": [
"127.0.0.0/8",
"::1/128",
"fd23:42:c3d2:500::/56",
"172.22.99.0/24",
"172.20.72.0/21",
"2a00:8180:2c00:200::/56",
"2a0f:5382:acab:1400::/56"
],
"pulse.min.req": "256/48000",
"pulse.default.req": "960/48000",
"pulse.min.frag": "256/48000",
"pulse.default.frag": "96000/48000",
"pulse.default.tlength": "96000/48000",
"pulse.min.quantum": "256/48000",
"pulse.default.format": "F32",
"server.address": [
"unix:native",
"tcp:4713"
]
}
}

View File

@ -1,4 +1,10 @@
{
"context.exec": [
{
"path": "pactl",
"args": "load-module module-always-sink"
}
],
"context.modules": [
{
"args": {
@ -23,35 +29,6 @@
"name": "libpipewire-module-metadata"
},
{
"args": {},
"name": "libpipewire-module-protocol-pulse"
},
{
"name": "libpipewire-module-zeroconf-publish"
},
{
"args": {
"auth-ip-acl": [
"127.0.0.0/8",
"::1/128",
"fd23:42:c3d2:500::/56",
"172.22.99.0/24",
"172.20.72.0/21",
"2a00:8180:2c00:200::/56",
"2a0f:5382:acab:1400::/56"
],
"pulse.default.format": "F32",
"pulse.default.frag": "96000/48000",
"pulse.default.req": "960/48000",
"pulse.default.tlength": "96000/48000",
"pulse.min.frag": "256/48000",
"pulse.min.quantum": "256/48000",
"pulse.min.req": "256/48000",
"server.address": [
"unix:native",
"tcp:4713"
]
},
"name": "libpipewire-module-protocol-pulse"
}
],
@ -60,16 +37,27 @@
"audio.convert.*": "audioconvert/libspa-audioconvert",
"support.*": "support/libspa-support"
},
"context.exec": [
{
"path": "pactl",
"args": "load-module module-always-sink"
}
],
"stream.properties": {},
"pulse.properties": {
"auth-ip-acl": [
"127.0.0.0/8",
"::1/128",
"fd23:42:c3d2:500::/56",
"172.22.99.0/24",
"172.20.72.0/21",
"2a00:8180:2c00:200::/56",
"2a0f:5382:acab:1400::/56"
],
"pulse.default.format": "F32",
"pulse.default.frag": "96000/48000",
"pulse.default.req": "960/48000",
"pulse.default.tlength": "96000/48000",
"pulse.min.frag": "256/48000",
"pulse.min.quantum": "256/48000",
"pulse.min.req": "256/48000",
"server.address": [
"unix:native"
"unix:native",
"tcp:4713"
],
"vm.overrides": {
"pulse.min.quantum": "1024/48000"

View File

@ -597,10 +597,14 @@
# build: outputs.nixosConfigurations.pulsebert.config.system.build.sdImage
# run: unzstd -cd result/sd-image/nixos-sd-image-*-aarch64-linux.img.zst | pv -br | sudo dd bs=4M of=/dev/sdX
"${inputs.nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel.nix"
{
nixpkgs = {
hostPlatform = "aarch64-linux";
# buildPlatform = "x86_64-linux";
};
}
];
nixpkgs = inputs.nixos-unstable;
# system = "x86_64-linux";
system = "aarch64-linux";
};
radiobert = nixosSystem' {

View File

@ -34,8 +34,10 @@
};
nix = {
buildCores = 2;
maxJobs = 1;
settings = {
cores = 2;
max-jobs = 1;
};
};
nixpkgs.config.packageOverrides = pkgs: {