diff options
author | Franck Cuny <franck@fcuny.net> | 2023-05-10 18:07:23 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2023-05-10 18:07:23 -0700 |
commit | 83b1ce4eb5d75adf818ea81bcb808f5149d9834a (patch) | |
tree | 63fc348860992a500f70c147783fa2f87a03eb78 /profiles | |
parent | profiles/unifi: fix variable (diff) | |
download | world-83b1ce4eb5d75adf818ea81bcb808f5149d9834a.tar.gz |
profiles/music-server: moved navidrome
Diffstat (limited to 'profiles')
-rw-r--r-- | profiles/music-server.nix | 40 |
1 files changed, 40 insertions, 0 deletions
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/" ]; + }; +} |