nixos-config/machines/chungus/media-navidrome.nix
Ingolf Wagner f6427e5237
All checks were successful
Build all NixOS Configurations / nix build (push) Successful in 9m55s
🔧 put nginx in front of navidrome
2024-11-02 16:35:32 +09:00

45 lines
1.1 KiB
Nix

{
config,
lib,
pkgs,
...
}:
{
healthchecks.http.navidrome = {
url = "${config.networking.hostName}.wg0:${toString config.services.navidrome.settings.Port}/app/#/login";
expectedContent = "Navidrome";
};
healthchecks.closed.retiolum.ports.navidrome = [ config.services.navidrome.settings.Port ];
services.navidrome = {
enable = true;
openFirewall = true;
group = "media";
user = "media";
settings.Address = "0.0.0.0";
settings.MusicFolder = "/media/arr/lidarr";
};
services.nginx = {
enable = true;
virtualHosts."music.${config.networking.hostName}.private" = {
serverAliases = [
"music.${config.networking.hostName}.wg0"
"music.ingolf-wagner.de"
];
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://localhost:${toString config.services.navidrome.settings.Port}";
extraConfig = ''
allow ${config.tinc.private.subnet};
allow ${config.wireguard.wg0.subnet};
deny all;
'';
};
};
};
}