From 9da7c7c9fc92c30e1bbf70c63be2034854c61857 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 25 Nov 2022 20:14:38 -0800 Subject: [PATCH] flammea: add mpd --- flammea.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/flammea.nix b/flammea.nix index 32cde73..bdc00ed 100644 --- a/flammea.nix +++ b/flammea.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: +let mpdStreamingPort = 8080; in { imports = [ @@ -106,6 +107,8 @@ # }; # networking.firewall.allowedTCPPorts = [ config.services.nix-serve.port ]; + networking.firewall.trustedInterfaces = [ "tailscale0" ]; + services.openssh.forwardX11 = true; fileSystems."/mnt/aplysia".device = pkgs.lib.mkOverride 10 "//aplysia.auroch-boa.ts.net/export"; @@ -147,4 +150,45 @@ system.stateVersion = "22.11"; + services.mpd = { + enable = true; + # network.listenAddress = "127.0.0.1"; + musicDirectory = "/mnt/aplysia/music"; + extraConfig = '' + bind_to_address "100.125.210.32" + + # audio_output { + # type "alsa" + # name "dac" + # device "sysdefault:CARD=QAMP" + # } + + audio_output { + type "pulse" + name "pulse" + server "127.0.0.1" + } + + audio_output { + type "httpd" + name "http" + encoder "flac" + port "${toString mpdStreamingPort}" + } + + replaygain "auto" + restore_paused "yes" + ''; + }; + + services.pipewire = { + config.pipewire-pulse = { + "pulse.properties"."server.address" = [ + "unix:native" + "tcp:127.0.0.1:4713" + # "tcp:100.97.134.100:4713" + ]; + }; + }; + }