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