diff options
Diffstat (limited to 'modules/services/navidrome')
-rw-r--r-- | modules/services/navidrome/default.nix | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/services/navidrome/default.nix b/modules/services/navidrome/default.nix index 6ea0038..87f7422 100644 --- a/modules/services/navidrome/default.nix +++ b/modules/services/navidrome/default.nix @@ -5,6 +5,11 @@ let in { options.my.services.navidrome = with lib; { enable = mkEnableOption "Navidrome Music Server"; + vhostName = mkOption { + type = types.str; + example = "music.fcuny.net"; + description = "Name for the virtual host"; + }; musicFolder = mkOption { type = types.str; example = "/data/fast/music"; @@ -15,28 +20,23 @@ in { config = lib.mkIf cfg.enable { services.navidrome = { enable = true; - settings = { - MusicFolder = cfg.musicFolder; - Address = "0.0.0.0"; - httpPort = "4533"; - }; + settings = { MusicFolder = cfg.musicFolder; }; }; - services.nginx.virtualHosts."music.fcuny.xyz" = { + services.nginx.virtualHosts."${cfg.vhostName}" = { forceSSL = true; - useACMEHost = "music.fcuny.xyz"; + useACMEHost = cfg.vhostName; locations."/" = { proxyPass = "http://127.0.0.1:4533"; proxyWebsockets = true; }; }; - security.acme.certs."music.fcuny.xyz" = { + security.acme.certs."${cfg.vhostName}" = { dnsProvider = "gcloud"; credentialsFile = secrets."acme/credentials".path; }; my.services.backup = { paths = [ "/var/lib/navidrome" ]; }; - networking.firewall.allowedTCPPorts = [ 4533 ]; }; } |