seporate mpd broadcasted hosts

This commit is contained in:
ChaotiCryptidz 2022-01-25 13:01:07 +00:00
parent e74bdefc73
commit bfe467a9eb
3 changed files with 34 additions and 19 deletions

View file

@ -0,0 +1,11 @@
{ tree, ... }: {
imports = with tree; [
# systemwide pulseaudio w/ recv native localhost
# to broadcast to all speakers over rtp
profiles.sound.pulseaudio.pulse-systemwide
profiles.sound.pulseaudio.pulse-recv-native-localhost
] ++ [
./hosts/lappy.nix
];
}

View file

@ -0,0 +1,21 @@
{ ... }:
let
sink_name = "rtp-lappy";
description = "Laptop Output";
ip_addr = "100.115.10.34";
in {
hardware.pulseaudio = {
extraConfig = ''
load-module module-null-sink sink_name=${sink_name} sink_properties="device.description='${description}'"
load-module module-rtp-send source=${sink_name}.monitor destination_ip=${ip_addr}
'';
};
services.mpd.extraConfig = ''
audio_output {
type "pulse"
name "${description}"
target "${sink_name}"
server "127.0.0.1"
}
'';
}

View file

@ -1,19 +1,8 @@
{ pkgs, lib, tree, ... }: {
imports = with tree; [
# systemwide pulseaudio w/ recv native localhost
# to broadcast to all speakers over rtp
profiles.sound.pulseaudio.pulse-systemwide
profiles.sound.pulseaudio.pulse-recv-native-localhost
imports = [
./mpd-broadcast/broadcast.nix
];
hardware.pulseaudio = {
extraConfig = ''
# laptop
load-module module-null-sink sink_name=rtp-lappy sink_properties="device.description='Laptop Output'"
load-module module-rtp-send source=rtp-lappy.monitor destination_ip=100.115.10.34
'';
};
environment.systemPackages = with pkgs; [ mpc_cli ];
services.mpd = {
@ -40,12 +29,6 @@
always_on "yes"
tags "yes"
}
audio_output {
type "pulse"
name "Lappy Out"
target "rtp-lappy"
server "127.0.0.1"
}
'';
};