From 83b1ce4eb5d75adf818ea81bcb808f5149d9834a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 10 May 2023 18:07:23 -0700 Subject: profiles/music-server: moved navidrome --- profiles/music-server.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 profiles/music-server.nix (limited to 'profiles') diff --git a/profiles/music-server.nix b/profiles/music-server.nix new file mode 100644 index 0000000..9ed665b --- /dev/null +++ b/profiles/music-server.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: +let + musicFolder = "/data/fast/music"; + vhostName = "music.${config.homelab.domain}"; +in +{ + # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/audio/navidrome.nix + services.navidrome = { + enable = true; + settings = { + MusicFolder = musicFolder; + }; + }; + + services.nginx.virtualHosts."${vhostName}" = { + forceSSL = true; + useACMEHost = config.homelab.domain; + listen = [ + { + addr = "192.168.6.40"; + port = 443; + ssl = true; + } + { + addr = "192.168.6.40"; + port = 80; + ssl = false; + } + ]; + locations."/" = { + proxyPass = "http://127.0.0.1:4533"; + proxyWebsockets = true; + }; + }; + + my.services.backup = { + paths = [ systemd.services.navidrome.WorkingDirectory ]; + exclude = [ "${systemd.services.navidrome.WorkingDirectory}/cache/" ]; + }; +} -- cgit 1.4.1