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" + ]; + }; + }; + }