From ed0965f80620c7183a863730cfa4282db4aaa777 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 6 May 2024 10:24:21 +0100 Subject: add media services --- hosts/laurel/configuration.nix | 1 + hosts/laurel/media.nix | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 hosts/laurel/media.nix (limited to 'hosts/laurel') diff --git a/hosts/laurel/configuration.nix b/hosts/laurel/configuration.nix index 6db299c..a2559ae 100644 --- a/hosts/laurel/configuration.nix +++ b/hosts/laurel/configuration.nix @@ -10,6 +10,7 @@ # Include the results of the hardware scan. ./hardware-configuration.nix ./servarr.nix + ./media.nix ]; # Use the systemd-boot EFI boot loader. diff --git a/hosts/laurel/media.nix b/hosts/laurel/media.nix new file mode 100644 index 0000000..b5d45dc --- /dev/null +++ b/hosts/laurel/media.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +{ + services.jellyfin = { + enable = true; + openFirewall = true; + group = "torrent"; + }; + services.nginx.virtualHosts."stream.${config.networking.hostName}" = { + listen = [{ port = 80; addr = "0.0.0.0"; }]; + locations."/" = { + proxyPass = "http://127.0.0.1:8096"; + proxyWebsockets = true; + }; + }; + + services.navidrome = { + enable = true; + openFirewall = true; + settings = { + MusicFolder = "/servarr/lidarr/"; + DataFolder = "/etc/navidrome/data"; + CacheFolder = "/etc/navidrome/cache"; + Address = "0.0.0.0"; + Port = 4533; + AuthRequestLimit = 0; + EnableTranscodingConfig = true; + }; + }; + services.nginx.virtualHosts."music.${config.networking.hostName}" = { + listen = [{ port = 80; addr = "0.0.0.0"; }]; + locations."/" = { + proxyPass = "http://127.0.0.1:${builtins.toString config.services.navidrome.settings.Port}"; + proxyWebsockets = true; + }; + }; + +} + -- cgit v1.2.3