From 48495851bad6b9daf7b4f32df6b40e8ad5c8eb79 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 28 Jul 2022 18:26:02 +0200 Subject: [PATCH] modules: services: grocy: fix SSL configuration --- modules/services/grocy/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/services/grocy/default.nix b/modules/services/grocy/default.nix index 22288e7..87927d6 100644 --- a/modules/services/grocy/default.nix +++ b/modules/services/grocy/default.nix @@ -2,6 +2,7 @@ { config, lib, ... }: let cfg = config.my.services.grocy; + grocyDomain = "grocy.${config.networking.domain}"; in { options.my.services.grocy = with lib; { @@ -13,10 +14,11 @@ in enable = true; # The service sets up the reverse proxy automatically - hostName = "grocy.${config.networking.domain}"; + hostName = grocyDomain; + # Configure SSL by hand nginx = { - enableSSL = true; + enableSSL = false; }; settings = { @@ -29,5 +31,10 @@ in }; }; }; + + services.nginx.virtualHosts."${grocyDomain}" = { + forceSSL = true; + useACMEHost = config.networking.domain; + }; }; }