Adjust snapserver config to work with 25.05
This commit is contained in:
parent
65e2a3e9f1
commit
b9e326dfe4
1 changed files with 23 additions and 39 deletions
|
|
@ -1,46 +1,30 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
let
|
||||
inherit (config.networking) ports;
|
||||
interfaces = import ../../interfaces.nix;
|
||||
cfg = config.services.snapserver;
|
||||
airplayPort1 = 5000;
|
||||
in
|
||||
{
|
||||
services.snapserver = {
|
||||
enable = true;
|
||||
port = ports.snapserver.tcp;
|
||||
tcp.port = ports.snapserverTcp.tcp;
|
||||
http.port = ports.snapserverHttp.tcp;
|
||||
streams = {
|
||||
default = {
|
||||
type = "meta";
|
||||
location = "meta:///hass/bluetooth/airplay/mopidy";
|
||||
query = {
|
||||
chunk_ms = "30";
|
||||
buffer = "690";
|
||||
codec = "flac";
|
||||
};
|
||||
settings = {
|
||||
tcp-streaming.port = ports.snapserver.tcp;
|
||||
tcp = {
|
||||
enabled = true;
|
||||
port = ports.snapserverTcp.tcp;
|
||||
};
|
||||
mopidy = {
|
||||
type = "pipe";
|
||||
location = "/run/snapserver/mopidy.fifo";
|
||||
};
|
||||
hass = {
|
||||
type = "pipe";
|
||||
location = "/run/snapserver/hass.fifo";
|
||||
};
|
||||
bluetooth = {
|
||||
location = "";
|
||||
type = "alsa";
|
||||
query = {
|
||||
device = "hw:bluetooth,1";
|
||||
};
|
||||
};
|
||||
airplay = {
|
||||
type = "airplay";
|
||||
location = lib.getExe' pkgs.shairport-sync "shairport-sync";
|
||||
query = {
|
||||
devicename = "Snapcast";
|
||||
};
|
||||
http = {
|
||||
enabled = true;
|
||||
port = ports.snapserverHttp.tcp;
|
||||
};
|
||||
stream.source = [
|
||||
"airplay://${pkgs.shairport-sync}/bin/shairport-sync?name=airplay&devicename=Snapcast&port=${toString airplayPort1}"
|
||||
#"alsa://?name=bluetooth&device=hw:bluetooth,1"
|
||||
"pipe:///run/snapserver/hass.fifo?name=hass"
|
||||
"pipe:///run/snapserver/mopidy.fifo?name=mopidy"
|
||||
"meta:///hass/airplay/mopidy?name=default&buffer=690&chunk_ms=30&codec=flac"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -55,10 +39,10 @@ in
|
|||
|
||||
networking.firewall.interfaces."${interfaces.lan}" = {
|
||||
allowedTCPPorts = [
|
||||
config.services.snapserver.http.port
|
||||
config.services.snapserver.port
|
||||
config.services.snapserver.tcp.port
|
||||
5000 # airplay
|
||||
cfg.settings.http.port
|
||||
cfg.settings.tcp.port
|
||||
cfg.settings.tcp-streaming.port
|
||||
airplayPort1
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{ from = 6001; to = 6011; } # airplay
|
||||
|
|
@ -67,7 +51,7 @@ in
|
|||
|
||||
networking.firewall.interfaces.iot = {
|
||||
allowedTCPPorts = [
|
||||
config.services.snapserver.port
|
||||
cfg.settings.stream.port
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue