X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fisabelle%2Faten_production.nix;h=e34d65913e86d6b6410f0ec7c71df16b8dcf5782;hp=cf7e4a25456ba270ace16571dab3696c02a83a42;hb=d3452fc59b9839846225fd254926c64a9c71f071;hpb=514f9ec3beec470c4445be690673a0ceab9115b4 diff --git a/modules/private/websites/isabelle/aten_production.nix b/modules/private/websites/isabelle/aten_production.nix index cf7e4a2..e34d659 100644 --- a/modules/private/websites/isabelle/aten_production.nix +++ b/modules/private/websites/isabelle/aten_production.nix @@ -1,21 +1,24 @@ { lib, pkgs, config, ... }: let secrets = config.myEnv.websites.isabelle.aten_production; - app = pkgs.webapps.aten.override { environment = secrets.environment; }; + app = pkgs.callPackage ./aten_app { + 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.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; @@ -37,7 +40,7 @@ in { }; secrets.keys = [{ - dest = "webapps/${app.environment}-aten"; + dest = "websites/isabelle/aten_production"; user = config.services.httpd.Prod.user; group = config.services.httpd.Prod.group; permissions = "0400"; @@ -52,18 +55,18 @@ in { 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 +76,7 @@ in { ErrorDocument 401 "" - + Options Indexes FollowSymLinks MultiViews Includes AllowOverride All Require all granted