services: add navidrome

This commit is contained in:
Antoine Martin 2021-08-22 16:40:57 +02:00
parent d8de5c1701
commit 7ce48f7164
2 changed files with 48 additions and 0 deletions

View file

@ -13,6 +13,7 @@
./media.nix ./media.nix
./miniflux.nix ./miniflux.nix
./monitoring.nix ./monitoring.nix
./navidrome.nix
./nextcloud.nix ./nextcloud.nix
./nginx.nix ./nginx.nix
./nuage.nix ./nuage.nix

47
services/navidrome.nix Normal file
View file

@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.my.services.navidrome;
domain = config.networking.domain;
in {
options.my.services.navidrome = {
enable = mkEnableOption "Navidrome";
};
config = lib.mkIf cfg.enable {
services.navidrome = {
enable = true;
settings = {
Address = "127.0.0.1";
Port = 4533;
LastFM.Enabled = false;
};
};
services.nginx.virtualHosts."music.${domain}" = {
forceSSL = true;
useACMEHost = domain;
listen = [
# FIXME: hardcoded tailscale IP
{
addr = "100.80.61.67";
port = 443;
ssl = true;
}
{
addr = "100.80.61.67";
port = 80;
ssl = false;
}
];
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.navidrome.settings.Port}/";
proxyWebsockets = true;
};
};
};
}