forked from c3d2/nix-config
audio-server: fix pipewire config
This commit is contained in:
parent
888888d182
commit
00000704ef
|
@ -1,5 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, is2305, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
# _____ _______ ____ _____
|
||||
# / ____|__ __/ __ \| __ \
|
||||
# | (___ | | | | | | |__) |
|
||||
# \___ \ | | | | | | ___/
|
||||
# ____) | | | | |__| | |
|
||||
# |_____/ |_| \____/|_|
|
||||
#
|
||||
# errors such as:
|
||||
# mod.zeroconf-publish: error id:47 seq:349 res:-2 (No such file or directory): enum params id:16 (Spa:Enum:ParamId:ProcessLatency) failed
|
||||
# are harmless and can be ignored. You most likely want to restart your local avahi-daemon: sudo systemctl restart avahi-daemon
|
||||
pipewireCfg = contextExec: {
|
||||
"context.exec" = contextExec ++ [
|
||||
{
|
||||
"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"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.c3d2.audioServer = {
|
||||
enable = lib.mkEnableOption "Enable PulseAudio and Bluetooth sinks";
|
||||
|
@ -8,14 +43,19 @@
|
|||
config = lib.mkIf config.c3d2.audioServer.enable {
|
||||
boot.kernelPackages = lib.mkOverride 900 pkgs.linuxPackages-rt_latest;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
mpd
|
||||
mpv
|
||||
ncmpcpp
|
||||
ncpamixer
|
||||
pulseaudio # required for pactl
|
||||
somafm-cli
|
||||
];
|
||||
environment = {
|
||||
etc = lib.optionalAttrs is2305 {
|
||||
"pipewire/pipewire.conf.d/audio-server.conf".text = builtins.toJSON (pipewireCfg [ ]);
|
||||
};
|
||||
systemPackages = with pkgs; [
|
||||
mpd
|
||||
mpv
|
||||
ncmpcpp
|
||||
ncpamixer
|
||||
pulseaudio # required for pactl
|
||||
somafm-cli
|
||||
];
|
||||
};
|
||||
|
||||
hardware = {
|
||||
bluetooth.settings = {
|
||||
|
@ -90,43 +130,13 @@
|
|||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true; # required for ledfx
|
||||
config.pipewire-pulse =
|
||||
let
|
||||
default-pipewire-pulse = lib.importJSON (pkgs.path + "/nixos/modules/services/desktops/pipewire/daemon/pipewire-pulse.conf.json");
|
||||
in
|
||||
# _____ _______ ____ _____
|
||||
# / ____|__ __/ __ \| __ \
|
||||
# | (___ | | | | | | |__) |
|
||||
# \___ \ | | | | | | ___/
|
||||
# ____) | | | | |__| | |
|
||||
# |_____/ |_| \____/|_|
|
||||
#
|
||||
# errors such as:
|
||||
# mod.zeroconf-publish: error id:47 seq:349 res:-2 (No such file or directory): enum params id:16 (Spa:Enum:ParamId:ProcessLatency) failed
|
||||
# are harmless and can be ignored. You most likely want to restart your local avahi-daemon: sudo systemctl restart avahi-daemon
|
||||
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"
|
||||
];
|
||||
};
|
||||
};
|
||||
config = lib.mkIf (!is2305) {
|
||||
pipewire-pulse =
|
||||
let
|
||||
default-pipewire-pulse = lib.importJSON (pkgs.path + "/nixos/modules/services/desktops/pipewire/daemon/pipewire-pulse.conf.json");
|
||||
in
|
||||
default-pipewire-pulse // (pipewireCfg default-pipewire-pulse."context.exec");
|
||||
};
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue