seporate mpd broadcasted hosts
This commit is contained in:
parent
e74bdefc73
commit
bfe467a9eb
11
hosts/hetzner-vm/services/mpd-broadcast/broadcast.nix
Normal file
11
hosts/hetzner-vm/services/mpd-broadcast/broadcast.nix
Normal 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
|
||||
];
|
||||
|
||||
}
|
21
hosts/hetzner-vm/services/mpd-broadcast/hosts/lappy.nix
Normal file
21
hosts/hetzner-vm/services/mpd-broadcast/hosts/lappy.nix
Normal 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"
|
||||
}
|
||||
'';
|
||||
}
|
|
@ -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"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue