From efc4d193fd77b0fe67c3288264e7f72516daebcb Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 10 Jun 2025 22:53:01 +0200 Subject: [PATCH] style(web): moving global nginx configuration in web.nix --- services/web.nix | 14 ++++++++++++++ services/web/portefolio.nix | 13 ++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/services/web.nix b/services/web.nix index 43712f7..6ad0c73 100644 --- a/services/web.nix +++ b/services/web.nix @@ -11,6 +11,20 @@ in portefolio ]; + config = { + services.nginx = { + enable = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + }; + security.acme = { + acceptTerms = true; + defaults.email = "raphael@parodi.pro"; + certs = { + "raphael.parodi.pro" = {}; + }; + }; + }; options.service.web = { portefolio = lib.mkOption { type = lib.types.bool; diff --git a/services/web/portefolio.nix b/services/web/portefolio.nix index 7944783..1e67439 100644 --- a/services/web/portefolio.nix +++ b/services/web/portefolio.nix @@ -22,24 +22,19 @@ in }; services.nginx = { - enable = true; - recommendedGzipSettings = true; - recommendedProxySettings = true; virtualHosts."raphael.parodi.pro" = { - forceSSL = true; + forceSSL = true; enableACME = true; locations."/" = { - root = "/opt/portefolio/dist"; - index = "index.html"; + root = "/opt/portefolio/dist"; + index = "index.html"; extraConfig = '' - try_files $uri /index.html; + try_files $uri /index.html; ''; }; }; }; security.acme = { - acceptTerms = true; - email = "raphael@parodi.pro"; certs = { "raphael.parodi.pro" = {}; };