diff options
Diffstat (limited to 'modules/private/websites/piedsjaloux')
-rw-r--r-- | modules/private/websites/piedsjaloux/builder.nix | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/modules/private/websites/piedsjaloux/builder.nix b/modules/private/websites/piedsjaloux/builder.nix index 9fcc8fb..d9a78b3 100644 --- a/modules/private/websites/piedsjaloux/builder.nix +++ b/modules/private/websites/piedsjaloux/builder.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { apacheUser, apacheGroup, piedsjaloux, config, pkgs, lib, texlive, imagemagick }: | 1 | { apacheUser, apacheGroup, piedsjaloux, config, pkgs, lib, mylibs, texlive, imagemagick }: |
2 | rec { | 2 | rec { |
3 | app = piedsjaloux.override { inherit (config) environment; }; | 3 | app = piedsjaloux.override { inherit (config) environment; }; |
4 | varDir = "/var/lib/piedsjaloux_${app.environment}"; | 4 | varDir = "/var/lib/piedsjaloux_${app.environment}"; |
@@ -27,18 +27,16 @@ rec { | |||
27 | ''; | 27 | ''; |
28 | }]; | 28 | }]; |
29 | phpFpm = rec { | 29 | phpFpm = rec { |
30 | preStart = '' | 30 | preStart = mylibs.phpFpmPreStart { |
31 | if [ ! -f "${app.varDir}/currentWebappDir" -o \ | 31 | inherit app; |
32 | ! -f "${app.varDir}/currentKey" -o \ | 32 | inherit (app) varDir; |
33 | "${app}" != "$(cat ${app.varDir}/currentWebappDir 2>/dev/null)" ] \ | 33 | keyFiles = [ |
34 | || ! sha512sum -c --status ${app.varDir}/currentKey; then | 34 | "/var/secrets/webapps/${app.environment}-piedsjaloux" |
35 | pushd ${app} > /dev/null | 35 | ]; |
36 | /run/wrappers/bin/sudo -u ${apacheUser} ./bin/console --env=${app.environment} cache:clear --no-warmup | 36 | actions = [ |
37 | popd > /dev/null | 37 | "/run/wrappers/bin/sudo -u ${apacheUser} ./bin/console --env=${app.environment} cache:clear --no-warmup" |
38 | echo -n "${app}" > ${app.varDir}/currentWebappDir | 38 | ]; |
39 | sha512sum /var/secrets/webapps/${app.environment}-piedsjaloux > ${app.varDir}/currentKey | 39 | }; |
40 | fi | ||
41 | ''; | ||
42 | serviceDeps = [ "mysql.service" ]; | 40 | serviceDeps = [ "mysql.service" ]; |
43 | socket = "/var/run/phpfpm/piedsjaloux-${app.environment}.sock"; | 41 | socket = "/var/run/phpfpm/piedsjaloux-${app.environment}.sock"; |
44 | pool = '' | 42 | pool = '' |