From e6c988a789466668f7c197288df0c26df1fedcf6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 30 Jul 2024 11:54:09 +0800 Subject: [PATCH] hosts/ni/setups/music: add UXPlay and update firewall settings --- configs/nixos/ni/modules/setups/music.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configs/nixos/ni/modules/setups/music.nix b/configs/nixos/ni/modules/setups/music.nix index 81680e36..35b770e7 100644 --- a/configs/nixos/ni/modules/setups/music.nix +++ b/configs/nixos/ni/modules/setups/music.nix @@ -3,6 +3,9 @@ let hostCfg = config.hosts.ni; cfg = hostCfg.setups.music; + + gonicPort = 4747; + uxplayPort = gonicPort + 1; in { options.hosts.ni.setups.music.enable = @@ -13,7 +16,7 @@ in services.gonic = { enable = true; settings = rec { - listen-addr = "localhost:4747"; + listen-addr = "localhost:${builtins.toString gonicPort}"; cache-path = "/var/cache/gonic"; music-path = [ @@ -28,5 +31,13 @@ in scan-at-start-enabled = true; }; }; + + # My AirPlay mirroring server. + services.uxplay = { + enable = true; + extraArgs = [ "-p" (builtins.toString uxplayPort) ]; + }; + + networking.firewall.allowedTCPPorts = [ gonicPort uxplayPort ]; }; }