i give up
This commit is contained in:
parent
66092dd42c
commit
c696c80012
|
@ -5,6 +5,6 @@
|
||||||
# to broadcast to all speakers over rtp
|
# to broadcast to all speakers over rtp
|
||||||
profiles.sound.pulseaudio.pulse-systemwide
|
profiles.sound.pulseaudio.pulse-systemwide
|
||||||
profiles.sound.pulseaudio.pulse-recv-native-localhost
|
profiles.sound.pulseaudio.pulse-recv-native-localhost
|
||||||
] ++ [ ./hosts/lappy.nix ];
|
] ++ [ ./hosts/lappy.nix ./hosts/raspberry.nix ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
21
hosts/hetzner-vm/services/mpd-broadcast/hosts/raspberry.nix
Normal file
21
hosts/hetzner-vm/services/mpd-broadcast/hosts/raspberry.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ ... }:
|
||||||
|
let
|
||||||
|
sink_name = "rtp-raspberry";
|
||||||
|
description = "Raspberry Output";
|
||||||
|
ip_addr = "100.118.202.64";
|
||||||
|
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,5 +1,5 @@
|
||||||
{ pkgs, lib, tree, ... }: {
|
{ pkgs, lib, tree, ... }: {
|
||||||
imports = [ ./mpd-broadcast/broadcast.nix ];
|
#imports = [ ./mpd-broadcast/broadcast.nix ];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ mpc_cli ];
|
environment.systemPackages = with pkgs; [ mpc_cli ];
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
profiles.tailscale
|
profiles.tailscale
|
||||||
profiles.sshd
|
profiles.sshd
|
||||||
|
|
||||||
# make bluetooth work on pi
|
hosts.raspberry.services.mpd-recv
|
||||||
hosts.raspberry.services.btattach
|
|
||||||
profiles.connectivity.bluetooth
|
profiles.connectivity.bluetooth
|
||||||
profiles.connectivity.ios
|
profiles.connectivity.ios
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
networking.useDHCP = true;
|
networking.useDHCP = true;
|
||||||
networking.wireless = {
|
networking.wireless = {
|
||||||
enable = false;
|
enable = true;
|
||||||
environmentFile = "/secrets/wifi-env";
|
environmentFile = "/secrets/wifi-env";
|
||||||
networks.BT-JGA898.psk = "@PSK_HOME@";
|
networks.BT-JGA898.psk = "@PSK_HOME@";
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
{ pkgs, ... }: {
|
|
||||||
systemd.services.btattach = {
|
|
||||||
before = [ "bluetooth.service" ];
|
|
||||||
after = [ "dev-ttyAMA0.device" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${pkgs.bluez}/bin/btattach -B /dev/ttyS1 -P bcm -S 3000000";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
18
hosts/raspberry/services/mpd-recv.nix
Normal file
18
hosts/raspberry/services/mpd-recv.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ tree, ... }: {
|
||||||
|
imports = with tree; [
|
||||||
|
profiles.connectivity.bluetooth
|
||||||
|
|
||||||
|
profiles.sound.pulseaudio.pulse
|
||||||
|
profiles.sound.pulseaudio.pulse-systemwide
|
||||||
|
profiles.sound.pulseaudio.pulse-bluetooth
|
||||||
|
profiles.sound.pulseaudio.pulse-recv-native-localhost
|
||||||
|
profiles.sound.pulseaudio.pulse-recv-rtp
|
||||||
|
];
|
||||||
|
|
||||||
|
hardware.pulseaudio.extraConfig = ''
|
||||||
|
load-module module-bluetooth-policy
|
||||||
|
load-module module-bluetooth-discover
|
||||||
|
set-default-sink bluez_card.3E_39_E7_B2_86_29
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
p
|
|
@ -1,7 +1,7 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
hardware.pulseaudio = {
|
hardware.pulseaudio = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
load-module module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=127.0.0.1;
|
load-module module-native-protocol-tcp auth-anonymous=1 auth-ip-acl=127.0.0.1;192.168.1.0/24;100.115.10.34
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
hardware.pulseaudio = {
|
hardware.pulseaudio = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
load-module module-rtp-recv latency_msec=50 sap_address=0.0.0.0
|
load-module module-rtp-recv latency_msec=500 sap_address=0.0.0.0
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue