From d3452fc59b9839846225fd254926c64a9c71f071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 18 Apr 2020 16:10:56 +0200 Subject: Refactor websites --- .../private/websites/isabelle/aten_integration.nix | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'modules/private/websites/isabelle/aten_integration.nix') diff --git a/modules/private/websites/isabelle/aten_integration.nix b/modules/private/websites/isabelle/aten_integration.nix index fb6eda9..61c35cc 100644 --- a/modules/private/websites/isabelle/aten_integration.nix +++ b/modules/private/websites/isabelle/aten_integration.nix @@ -1,20 +1,23 @@ { lib, pkgs, config, ... }: let secrets = config.myEnv.websites.isabelle.aten_integration; - app = pkgs.webapps.aten.override { environment = secrets.environment; }; + app = pkgs.callPackage ./aten_app { + environment = secrets.environment; + varDir = "/var/lib/isabelle_aten_integration"; + }; cfg = config.myServices.websites.isabelle.aten_integration; pcfg = config.services.phpApplication; in { options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration"; config = lib.mkIf cfg.enable { - services.duplyBackup.profiles.aten_dev.rootDir = app.varDir; - services.phpApplication.apps.aten_dev = { + services.duplyBackup.profiles.isabelle_aten_integration.rootDir = app.varDir; + services.phpApplication.apps.isabelle_aten_integration = { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; httpdGroup = config.services.httpd.Inte.group; httpdWatchFiles = [ - config.secrets.fullPaths."webapps/${app.environment}-aten" + config.secrets.fullPaths."websites/isabelle/aten_integration" ]; inherit (app) webRoot varDir; inherit app; @@ -32,12 +35,12 @@ in { "pm.process_idle_timeout" = "60"; }; phpEnv = { - SYMFONY_DEBUG_MODE = "yes"; + SYMFONY_DEBUG_MODE = "\"yes\""; }; }; secrets.keys = [{ - dest = "webapps/${app.environment}-aten"; + dest = "websites/isabelle/aten_integration"; user = config.services.httpd.Inte.user; group = config.services.httpd.Inte.group; permissions = "0400"; @@ -52,18 +55,18 @@ in { SetEnv DATABASE_URL "${psql_url}" ''; }]; - services.websites.env.integration.vhostConfs.aten_dev = { + services.websites.env.integration.vhostConfs.isabelle_aten_integration = { certName = "integration"; addToCerts = true; hosts = [ "dev.aten.pro" ]; - root = pcfg.webappDirs.aten_dev; + root = pcfg.webappDirs.isabelle_aten_integration; extraConfig = [ '' - SetHandler "proxy:unix:${pcfg.phpListenPaths.aten_dev}|fcgi://localhost" + SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_integration}|fcgi://localhost" - Include ${config.secrets.fullPaths."webapps/${app.environment}-aten"} + Include ${config.secrets.fullPaths."websites/isabelle/aten_integration"} Use LDAPConnect @@ -77,7 +80,7 @@ in { ErrorDocument 401 "" - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride All Require all granted -- cgit v1.2.3