X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fisabelle%2Faten_production.nix;h=b8d12b94351f779597ab17fda7ca52b8bafa8f16;hb=4c4652aabf2cb3ac8b40f2856eca07a1df9c27e0;hp=cf7e4a25456ba270ace16571dab3696c02a83a42;hpb=5400b9b6f65451d41a9106fae6fc00f97d83f4ef;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/isabelle/aten_production.nix b/modules/private/websites/isabelle/aten_production.nix index cf7e4a2..b8d12b9 100644 --- a/modules/private/websites/isabelle/aten_production.nix +++ b/modules/private/websites/isabelle/aten_production.nix @@ -1,21 +1,26 @@ { lib, pkgs, config, ... }: let secrets = config.myEnv.websites.isabelle.aten_production; - app = pkgs.webapps.aten.override { environment = secrets.environment; }; + app = pkgs.callPackage ./aten_app { + composerEnv = pkgs.composerEnv.override { php = pkgs.php72; }; + environment = secrets.environment; + varDir = "/var/lib/isabelle_aten_production"; + }; cfg = config.myServices.websites.isabelle.aten_production; pcfg = config.services.phpApplication; in { options.myServices.websites.isabelle.aten_production.enable = lib.mkEnableOption "enable Aten's website in production"; config = lib.mkIf cfg.enable { - services.duplyBackup.profiles.aten_prod.rootDir = app.varDir; + services.duplyBackup.profiles.isabelle_aten_production.rootDir = app.varDir; + services.duplyBackup.profiles.isabelle_aten_production.remotes = ["eriomem" "ovh"]; services.webstats.sites = [ { name = "aten.pro"; } ]; - services.phpApplication.apps.aten_prod = { + services.phpApplication.apps.isabelle_aten_production = { websiteEnv = "production"; httpdUser = config.services.httpd.Prod.user; httpdGroup = config.services.httpd.Prod.group; httpdWatchFiles = [ - config.secrets.fullPaths."webapps/${app.environment}-aten" + config.secrets.fullPaths."websites/isabelle/aten_production" ]; inherit (app) webRoot varDir; inherit app; @@ -34,10 +39,10 @@ in { "pm.min_spare_servers" = "1"; "pm.max_spare_servers" = "3"; }; + phpPackage = pkgs.php72; }; - secrets.keys = [{ - dest = "webapps/${app.environment}-aten"; + secrets.keys."websites/isabelle/aten_production" = { user = config.services.httpd.Prod.user; group = config.services.httpd.Prod.group; permissions = "0400"; @@ -51,19 +56,19 @@ in { SetEnv APP_SECRET "${secrets.secret}" SetEnv DATABASE_URL "${psql_url}" ''; - }]; - services.websites.env.production.vhostConfs.aten_prod = { - certName = "aten"; + }; + services.websites.env.production.vhostConfs.isabelle_aten_production = { + certName = "isabelle"; certMainHost = "aten.pro"; hosts = [ "aten.pro" "www.aten.pro" ]; - root = pcfg.webappDirs.aten_prod; + root = pcfg.webappDirs.isabelle_aten_production; extraConfig = [ '' - SetHandler "proxy:unix:${pcfg.phpListenPaths.aten_prod}|fcgi://localhost" + SetHandler "proxy:unix:${pcfg.phpListenPaths.isabelle_aten_production}|fcgi://localhost" - Include ${config.secrets.fullPaths."webapps/${app.environment}-aten"} + Include ${config.secrets.fullPaths."websites/isabelle/aten_production"} Use Stats aten.pro @@ -73,7 +78,7 @@ in { ErrorDocument 401 "" - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride All Require all granted