From f40f5b235b890f46770a22f005f8a0f664cf0562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 21 May 2019 02:47:52 +0200 Subject: Replace myPhpfpm with correct overrides --- modules/private/websites/aten/integration.nix | 7 +++-- modules/private/websites/aten/production.nix | 7 +++-- modules/private/websites/chloe/builder.nix | 1 - modules/private/websites/chloe/integration.nix | 12 +++++--- modules/private/websites/chloe/production.nix | 12 +++++--- .../private/websites/connexionswing/builder.nix | 1 - .../websites/connexionswing/integration.nix | 12 +++++--- .../private/websites/connexionswing/production.nix | 12 +++++--- modules/private/websites/florian/app.nix | 7 +++-- modules/private/websites/immae/production.nix | 2 +- modules/private/websites/leila/production.nix | 2 +- .../websites/ludivinecassal/integration.nix | 7 +++-- .../private/websites/ludivinecassal/production.nix | 7 +++-- .../private/websites/naturaloutil/production.nix | 35 ++++++++++++---------- .../private/websites/piedsjaloux/integration.nix | 7 +++-- .../private/websites/piedsjaloux/production.nix | 7 +++-- 16 files changed, 81 insertions(+), 57 deletions(-) (limited to 'modules') diff --git a/modules/private/websites/aten/integration.nix b/modules/private/websites/aten/integration.nix index 790c5a9..5ccc0c1 100644 --- a/modules/private/websites/aten/integration.nix +++ b/modules/private/websites/aten/integration.nix @@ -13,9 +13,10 @@ in { config = lib.mkIf cfg.enable { secrets.keys = aten.keys; - services.myPhpfpm.preStart.aten_dev = aten.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.aten_dev = aten.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.aten_dev = aten.phpFpm.pool; + systemd.services.phpfpm-aten_dev.preStart = lib.mkAfter aten.phpFpm.preStart; + systemd.services.phpfpm-aten_dev.after = lib.mkAfter aten.phpFpm.serviceDeps; + systemd.services.phpfpm-aten_dev.wants = aten.phpFpm.serviceDeps; + services.phpfpm.poolConfigs.aten_dev = aten.phpFpm.pool; system.activationScripts.aten_dev = aten.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/aten/production.nix b/modules/private/websites/aten/production.nix index 697f1b8..7938241 100644 --- a/modules/private/websites/aten/production.nix +++ b/modules/private/websites/aten/production.nix @@ -15,9 +15,10 @@ in { secrets.keys = aten.keys; services.webstats.sites = [ { name = "aten.pro"; } ]; - services.myPhpfpm.preStart.aten_prod = aten.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.aten_prod = aten.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.aten_prod = aten.phpFpm.pool; + systemd.services.phpfpm-aten_prod.preStart = lib.mkAfter aten.phpFpm.preStart; + systemd.services.phpfpm-aten_prod.after = lib.mkAfter aten.phpFpm.serviceDeps; + systemd.services.phpfpm-aten_prod.wants = aten.phpFpm.serviceDeps; + services.phpfpm.poolConfigs.aten_prod = aten.phpFpm.pool; system.activationScripts.aten_prod = aten.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/chloe/builder.nix b/modules/private/websites/chloe/builder.nix index 7b72b97..f65e9a9 100644 --- a/modules/private/websites/chloe/builder.nix +++ b/modules/private/websites/chloe/builder.nix @@ -5,7 +5,6 @@ rec { serviceDeps = [ "mysql.service" ]; socket = "/var/run/phpfpm/chloe-${app.environment}.sock"; pool = '' - listen = ${socket} user = ${apacheUser} group = ${apacheGroup} listen.owner = ${apacheUser} diff --git a/modules/private/websites/chloe/integration.nix b/modules/private/websites/chloe/integration.nix index 458e414..d49a85c 100644 --- a/modules/private/websites/chloe/integration.nix +++ b/modules/private/websites/chloe/integration.nix @@ -13,11 +13,15 @@ in { config = lib.mkIf cfg.enable { secrets.keys = chloe.keys; - services.myPhpfpm.serviceDependencies.chloe_dev = chloe.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.chloe_dev = chloe.phpFpm.pool; - services.myPhpfpm.poolPhpConfigs.chloe_dev = '' - extension=${pkgs.php}/lib/php/extensions/mysqli.so + systemd.services.phpfpm-chloe_dev.after = lib.mkAfter chloe.phpFpm.serviceDeps; + systemd.services.phpfpm-chloe_dev.wants = chloe.phpFpm.serviceDeps; + services.phpfpm.pools.chloe_dev = { + listen = chloe.phpFpm.socket; + extraConfig = chloe.phpFpm.pool; + phpOptions = config.services.phpfpm.phpOptions + '' + extension=${pkgs.php}/lib/php/extensions/mysqli.so ''; + }; system.activationScripts.chloe_dev = chloe.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix index 0eafebd..d4b2299 100644 --- a/modules/private/websites/chloe/production.nix +++ b/modules/private/websites/chloe/production.nix @@ -15,11 +15,15 @@ in { secrets.keys = chloe.keys; services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ]; - services.myPhpfpm.serviceDependencies.chloe_prod = chloe.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.chloe_prod = chloe.phpFpm.pool; - services.myPhpfpm.poolPhpConfigs.chloe_prod = '' - extension=${pkgs.php}/lib/php/extensions/mysqli.so + systemd.services.phpfpm-chloe_prod.after = lib.mkAfter chloe.phpFpm.serviceDeps; + systemd.services.phpfpm-chloe_prod.wants = chloe.phpFpm.serviceDeps; + services.phpfpm.pools.chloe_prod = { + listen = chloe.phpFpm.socket; + extraConfig = chloe.phpFpm.pool; + phpOptions = config.services.phpfpm.phpOptions + '' + extension=${pkgs.php}/lib/php/extensions/mysqli.so ''; + }; system.activationScripts.chloe_prod = chloe.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/connexionswing/builder.nix b/modules/private/websites/connexionswing/builder.nix index 1224420..b4b04cb 100644 --- a/modules/private/websites/connexionswing/builder.nix +++ b/modules/private/websites/connexionswing/builder.nix @@ -49,7 +49,6 @@ rec { extension=${phpPackages.imagick}/lib/php/extensions/imagick.so ''; pool = '' - listen = ${socket} user = ${apacheUser} group = ${apacheGroup} listen.owner = ${apacheUser} diff --git a/modules/private/websites/connexionswing/integration.nix b/modules/private/websites/connexionswing/integration.nix index c3425bd..6570977 100644 --- a/modules/private/websites/connexionswing/integration.nix +++ b/modules/private/websites/connexionswing/integration.nix @@ -13,10 +13,14 @@ in { config = lib.mkIf cfg.enable { secrets.keys = connexionswing.keys; - services.myPhpfpm.preStart.connexionswing_dev = connexionswing.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.connexionswing_dev = connexionswing.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.connexionswing_dev = connexionswing.phpFpm.pool; - services.myPhpfpm.poolPhpConfigs.connexionswing_dev = connexionswing.phpFpm.phpConfig; + systemd.services.phpfpm-connexionswing_dev.after = lib.mkAfter connexionswing.phpFpm.serviceDeps; + systemd.services.phpfpm-connexionswing_dev.wants = connexionswing.phpFpm.serviceDeps; + systemd.services.phpfpm-connexionswing_dev.preStart = lib.mkAfter connexionswing.phpFpm.preStart; + services.phpfpm.pools.connexionswing_dev = { + listen = connexionswing.phpFpm.socket; + extraConfig = connexionswing.phpFpm.pool; + phpOptions = config.services.phpfpm.phpOptions + connexionswing.phpFpm.phpConfig; + }; system.activationScripts.connexionswing_dev = connexionswing.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/connexionswing/production.nix b/modules/private/websites/connexionswing/production.nix index 8f28f46..b51c549 100644 --- a/modules/private/websites/connexionswing/production.nix +++ b/modules/private/websites/connexionswing/production.nix @@ -15,10 +15,14 @@ in { secrets.keys = connexionswing.keys; services.webstats.sites = [ { name = "connexionswing.com"; } ]; - services.myPhpfpm.preStart.connexionswing_prod = connexionswing.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.connexionswing_prod = connexionswing.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.connexionswing_prod = connexionswing.phpFpm.pool; - services.myPhpfpm.poolPhpConfigs.connexionswing_prod = connexionswing.phpFpm.phpConfig; + systemd.services.phpfpm-connexionswing_prod.after = lib.mkAfter connexionswing.phpFpm.serviceDeps; + systemd.services.phpfpm-connexionswing_prod.wants = connexionswing.phpFpm.serviceDeps; + systemd.services.phpfpm-connexionswing_prod.preStart = lib.mkAfter connexionswing.phpFpm.preStart; + services.phpfpm.pools.connexionswing_prod = { + listen = connexionswing.phpFpm.socket; + extraConfig = connexionswing.phpFpm.pool; + phpOptions = config.services.phpfpm.phpOptions + connexionswing.phpFpm.phpConfig; + }; system.activationScripts.connexionswing_prod = connexionswing.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/florian/app.nix b/modules/private/websites/florian/app.nix index 08506e1..905c66a 100644 --- a/modules/private/websites/florian/app.nix +++ b/modules/private/websites/florian/app.nix @@ -15,9 +15,10 @@ in { config = lib.mkIf cfg.enable { secrets.keys = tellesflorian.keys; - services.myPhpfpm.preStart.tellesflorian_dev = tellesflorian.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.tellesflorian_dev = tellesflorian.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.tellesflorian_dev = tellesflorian.phpFpm.pool; + systemd.services.phpfpm-tellesflorian_dev.after = lib.mkAfter tellesflorian.phpFpm.serviceDeps; + systemd.services.phpfpm-tellesflorian_dev.wants = tellesflorian.phpFpm.serviceDeps; + systemd.services.phpfpm-tellesflorian_dev.preStart = lib.mkAfter tellesflorian.phpFpm.preStart; + services.phpfpm.poolConfigs.tellesflorian_dev = tellesflorian.phpFpm.pool; system.activationScripts.tellesflorian_dev = tellesflorian.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/immae/production.nix b/modules/private/websites/immae/production.nix index 58cf048..c3cabb6 100644 --- a/modules/private/websites/immae/production.nix +++ b/modules/private/websites/immae/production.nix @@ -9,7 +9,7 @@ in { config = lib.mkIf cfg.enable { services.webstats.sites = [ { name = "www.immae.eu"; } ]; - services.myPhpfpm.poolConfigs.immae = '' + services.phpfpm.poolConfigs.immae = '' listen = /run/phpfpm/immae.sock user = wwwrun group = wwwrun diff --git a/modules/private/websites/leila/production.nix b/modules/private/websites/leila/production.nix index 1ce8eea..69c8c49 100644 --- a/modules/private/websites/leila/production.nix +++ b/modules/private/websites/leila/production.nix @@ -6,7 +6,7 @@ in { options.myServices.websites.leila.production.enable = lib.mkEnableOption "enable Leila's website in production"; config = lib.mkIf cfg.enable { - services.myPhpfpm.poolConfigs.leila = '' + services.phpfpm.poolConfigs.leila = '' listen = /run/phpfpm/leila.sock user = wwwrun group = wwwrun diff --git a/modules/private/websites/ludivinecassal/integration.nix b/modules/private/websites/ludivinecassal/integration.nix index 0be067b..a53f1fe 100644 --- a/modules/private/websites/ludivinecassal/integration.nix +++ b/modules/private/websites/ludivinecassal/integration.nix @@ -14,9 +14,10 @@ in { config = lib.mkIf cfg.enable { secrets.keys = ludivinecassal.keys; - services.myPhpfpm.preStart.ludivinecassal_dev = ludivinecassal.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.ludivinecassal_dev = ludivinecassal.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.ludivinecassal_dev = ludivinecassal.phpFpm.pool; + systemd.services.phpfpm-ludivinecassal_dev.after = lib.mkAfter ludivinecassal.phpFpm.serviceDeps; + systemd.services.phpfpm-ludivinecassal_dev.wants = ludivinecassal.phpFpm.serviceDeps; + systemd.services.phpfpm-ludivinecassal_dev.preStart = lib.mkAfter ludivinecassal.phpFpm.preStart; + services.phpfpm.poolConfigs.ludivinecassal_dev = ludivinecassal.phpFpm.pool; system.activationScripts.ludivinecassal_dev = ludivinecassal.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/ludivinecassal/production.nix b/modules/private/websites/ludivinecassal/production.nix index c5de698..8fe6812 100644 --- a/modules/private/websites/ludivinecassal/production.nix +++ b/modules/private/websites/ludivinecassal/production.nix @@ -15,9 +15,10 @@ in { secrets.keys = ludivinecassal.keys; services.webstats.sites = [ { name = "ludivinecassal.com"; } ]; - services.myPhpfpm.preStart.ludivinecassal_prod = ludivinecassal.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.ludivinecassal_prod = ludivinecassal.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal.phpFpm.pool; + systemd.services.phpfpm-ludivinecassal_prod.after = lib.mkAfter ludivinecassal.phpFpm.serviceDeps; + systemd.services.phpfpm-ludivinecassal_prod.wants = ludivinecassal.phpFpm.serviceDeps; + systemd.services.phpfpm-ludivinecassal_prod.preStart = lib.mkAfter ludivinecassal.phpFpm.preStart; + services.phpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal.phpFpm.pool; system.activationScripts.ludivinecassal_prod = ludivinecassal.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/naturaloutil/production.nix b/modules/private/websites/naturaloutil/production.nix index b6cf069..2315b30 100644 --- a/modules/private/websites/naturaloutil/production.nix +++ b/modules/private/websites/naturaloutil/production.nix @@ -33,24 +33,27 @@ in { ?> ''; }]; - services.myPhpfpm.serviceDependencies.jerome = [ "mysql.service" ]; - services.myPhpfpm.poolConfigs.jerome = '' - listen = /run/phpfpm/naturaloutil.sock - user = wwwrun - group = wwwrun - listen.owner = wwwrun - listen.group = wwwrun + systemd.services.phpfpm-jerome.after = lib.mkAfter [ "mysql.service" ]; + systemd.services.phpfpm-jerome.wants = [ "mysql.service" ]; + services.phpfpm.pools.jerome = { + listen = "/run/phpfpm/naturaloutil.sock"; + extraConfig = '' + user = wwwrun + group = wwwrun + listen.owner = wwwrun + listen.group = wwwrun - pm = ondemand - pm.max_children = 5 - pm.process_idle_timeout = 60 + pm = ondemand + pm.max_children = 5 + pm.process_idle_timeout = 60 - env[BDD_CONNECT] = "/var/secrets/webapps/prod-naturaloutil" - php_admin_value[open_basedir] = "/var/secrets/webapps/prod-naturaloutil:${varDir}:/tmp" - ''; - services.myPhpfpm.poolPhpConfigs.jerome = '' - extension=${pkgs.php}/lib/php/extensions/mysqli.so - ''; + env[BDD_CONNECT] = "/var/secrets/webapps/prod-naturaloutil" + php_admin_value[open_basedir] = "/var/secrets/webapps/prod-naturaloutil:${varDir}:/tmp" + ''; + phpOptions = config.services.phpfpm.phpOptions + '' + extension=${pkgs.php}/lib/php/extensions/mysqli.so + ''; + }; services.websites.production.modules = adminer.apache.modules ++ [ "proxy_fcgi" ]; services.websites.production.vhostConfs.naturaloutil = { certName = "naturaloutil"; diff --git a/modules/private/websites/piedsjaloux/integration.nix b/modules/private/websites/piedsjaloux/integration.nix index 6249e85..83b428a 100644 --- a/modules/private/websites/piedsjaloux/integration.nix +++ b/modules/private/websites/piedsjaloux/integration.nix @@ -13,9 +13,10 @@ in { config = lib.mkIf cfg.enable { secrets.keys = piedsjaloux.keys; - services.myPhpfpm.preStart.piedsjaloux_dev = piedsjaloux.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.piedsjaloux_dev = piedsjaloux.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux.phpFpm.pool; + systemd.services.phpfpm-piedsjaloux_dev.after = lib.mkAfter piedsjaloux.phpFpm.serviceDeps; + systemd.services.phpfpm-piedsjaloux_dev.wants = piedsjaloux.phpFpm.serviceDeps; + systemd.services.phpfpm-piedsjaloux_dev.preStart = lib.mkAfter piedsjaloux.phpFpm.preStart; + services.phpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux.phpFpm.pool; system.activationScripts.piedsjaloux_dev = piedsjaloux.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps diff --git a/modules/private/websites/piedsjaloux/production.nix b/modules/private/websites/piedsjaloux/production.nix index afa1667..0efd56b 100644 --- a/modules/private/websites/piedsjaloux/production.nix +++ b/modules/private/websites/piedsjaloux/production.nix @@ -15,9 +15,10 @@ in { secrets.keys = piedsjaloux.keys; services.webstats.sites = [ { name = "piedsjaloux.fr"; } ]; - services.myPhpfpm.preStart.piedsjaloux_prod = piedsjaloux.phpFpm.preStart; - services.myPhpfpm.serviceDependencies.piedsjaloux_prod = piedsjaloux.phpFpm.serviceDeps; - services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux.phpFpm.pool; + systemd.services.phpfpm-piedsjaloux_prod.after = lib.mkAfter piedsjaloux.phpFpm.serviceDeps; + systemd.services.phpfpm-piedsjaloux_prod.wants = piedsjaloux.phpFpm.serviceDeps; + systemd.services.phpfpm-piedsjaloux_prod.preStart = lib.mkAfter piedsjaloux.phpFpm.preStart; + services.phpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux.phpFpm.pool; system.activationScripts.piedsjaloux_prod = piedsjaloux.activationScript; system.extraSystemBuilderCmds = '' mkdir -p $out/webapps -- cgit v1.2.3