diff --git a/systems/x86_64-linux/stargate/services/navidrome.nix b/systems/x86_64-linux/stargate/services/navidrome.nix new file mode 100644 index 0000000..0e04aa5 --- /dev/null +++ b/systems/x86_64-linux/stargate/services/navidrome.nix @@ -0,0 +1,23 @@ +{ + pkgs, + lib, + config, + ... +}: { + systemd.services.navidrome.serviceConfig.ExecStart = with lib; let + cfg = config.services.navidrome; + settingsFormat = pkgs.formats.toml {}; + in + mkForce '' + ${pkgs.bash}/bin/bash -c "${getExe cfg.package} --configfile '${settingsFormat.generate "navidrome.toml" cfg.settings}'" + ''; + services.navidrome = { + enable = true; + settings = { + Scanner.Schedule = "@every 24h"; + MusicFolder = "/zstorage/media/music"; + EnableSharing = true; + BaseUrl = "https://music.kylekrein.com"; + }; + }; +} diff --git a/systems/x86_64-linux/stargate/services/nginx.nix b/systems/x86_64-linux/stargate/services/nginx.nix index 2738d20..168f728 100644 --- a/systems/x86_64-linux/stargate/services/nginx.nix +++ b/systems/x86_64-linux/stargate/services/nginx.nix @@ -67,6 +67,18 @@ in { }; }; + "music.kylekrein.com" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://${toString config.services.navidrome.settings.Address}:${toString config.services.navidrome.settings.Port}"; + proxyWebsockets = true; + extraConfig = '' + client_max_body_size 100M; + ''; + }; + }; + "${config.services.nextcloud.hostName}" = { enableACME = true; forceSSL = true;