+ phpPackage = pkgs.php72;
+ };
+ systemd.services."phpfpm-isabelle_aten_integration" = {
+ after = lib.mkAfter ["postgresql.service"];
+ wants = ["postgresql.service"];
+ path = lib.mkAfter [ pkgs.gnutar pkgs.gzip pkgs.php72 ];
+ preStart = let
+ script = pkgs.writeScriptBin "isabelle-aten-integration" ''
+ #! ${pkgs.stdenv.shell}
+
+ [ -f ${packagePath}/${branch}.tar.gz ] || exit 1
+
+ cd ${ftpRoot}
+ if ! [ -f .tarball_sum ] || ! sha256sum -c .tarball_sum; then
+ tar -xf ${packagePath}/${branch}.tar.gz --one-top-level=php_new
+ if [ -d php ]; then
+ mv php php_old
+ fi
+ mv php_new php
+ fi
+ cd php
+ rm -rf var/{log,cache}
+ ln -sf ${varDir}/{log,cache} var/
+ SYMFONY_ENV=dev APP_ENV=dev ./bin/console --env=dev cache:clear --no-warmup
+ sha256sum ${packagePath}/${branch}.tar.gz > ${ftpRoot}/.tarball_sum
+ '';
+ in
+ "/run/wrappers/bin/sudo -u ${config.services.httpd.Inte.user} ${script}/bin/isabelle-aten-integration";
+ postStart = let
+ script = pkgs.writeScriptBin "isabelle-aten-integration-post" ''
+ #! ${pkgs.stdenv.shell}
+
+ cd ${ftpRoot}
+ if [ -d php_old ]; then
+ rm -rf php_old
+ fi
+ '';
+ in
+ "/run/wrappers/bin/sudo -u ${config.services.httpd.Inte.user} ${script}/bin/isabelle-aten-integration-post";
+ serviceConfig.TimeoutStartSec="infinity";
+ };
+ services.filesWatcher.phpfpm-isabelle_aten_integration = {
+ restart = true;
+ paths = [ "${packagePath}/${branch}.tar.gz" ];