From cf47bf50f7a222cba8107487aa2dafc747318cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 14 May 2023 23:13:58 +0200 Subject: [PATCH] pipebert: add mopidy --- hosts/pipebert/default.nix | 50 +++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/hosts/pipebert/default.nix b/hosts/pipebert/default.nix index 4a027d8d..e1dd3689 100644 --- a/hosts/pipebert/default.nix +++ b/hosts/pipebert/default.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -46,6 +46,27 @@ }; services = { + mopidy = { + enable = true; + configuration = '' + [audio] + output = pulsesink server=127.0.0.1 + + [core] + restore_state = true + + [http] + allowed_origins = + cristianpb.github.io + mopster.urizen.pl + + [youtube] + allow_cache = true + youtube_dl_package = yt_dlp + ''; + extensionPackages = with pkgs; [ mopidy-muse mopidy-youtube python3Packages.yt-dlp ]; + }; + nginx = { enable = true; virtualHosts = { @@ -79,9 +100,30 @@ "pipebert.hq.c3d2.de" = { enableACME = true; forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8888"; - proxyWebsockets = true; + locations = { + "/" = { + extraConfig = '' + add_header Content-Type text/html; + ''; + return = ''200 ' + + + + + ' ''; + }; + "/mopidy/" = { + proxyPass = "http://127.0.0.1:6680"; + proxyWebsockets = true; + }; + "/ledfx/" = { + proxyPass = "http://127.0.0.1:8888"; + proxyWebsockets = true; + }; }; }; };