]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix files watcher path
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 3 Jun 2019 11:25:26 +0000 (13:25 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 3 Jun 2019 11:25:26 +0000 (13:25 +0200)
lib/private/default.nix
modules/private/websites/tools/tools/default.nix
modules/private/websites/tools/tools/wallabag.nix

index b04f7b3902b1bf1556a98e5acb6334b7e843dbb3..c7d753a30e8ffb7542ef905d0b23abc167c71a38 100644 (file)
       echo
     }
   '';
-
-  phpFpmPreStart = { app, varDir, keyFiles, actions }: ''
-    if [ ! -f "${varDir}/currentWebappDir" -o \
-        ! -f "${varDir}/currentKey" -o \
-        "${app}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \
-        || ! sha512sum -c --status ${varDir}/currentKey; then
-      pushd ${app} > /dev/null
-      ${builtins.concatStringsSep "\n  " actions}
-      popd > /dev/null
-      echo -n "${app}" > ${varDir}/currentWebappDir
-      sha512sum ${builtins.concatStringsSep " " keyFiles} > ${varDir}/currentKey
-    fi
-  '';
 }
index 5ca9851175025f18ac6f7bfe723171eac588ffe6..9908d9935da41da3e8d9aa6eeb9985fa6a8a5a3a 100644 (file)
@@ -303,7 +303,7 @@ in {
     };
 
     services.websites.env.tools.watchPaths = [
-      "/var/secrets/webapps/tools-wallabag"
+      "/var/secrets/webapps/tools-shaarli"
     ];
     services.filesWatcher.phpfpm-wallabag = {
       restart = true;
index ba755e4d514fbc3636960f0f0e906f138a528e8c..2912b2c9b3ef0692b9c09fdaf05bc624b1d56519 100644 (file)
@@ -110,18 +110,20 @@ rec {
       '';
   };
   phpFpm = rec {
-    preStart = mylibs.phpFpmPreStart {
-      app = webappDir;
-      inherit varDir;
-      keyFiles = [
-        "/var/secrets/webapps/tools-wallabag"
-      ];
-      actions = [
-        "/run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod cache:clear"
-        "rm -rf /var/lib/wallabag/var/cache/pro_"
-        "/run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod doctrine:migrations:migrate --no-interaction"
-      ];
-    };
+    preStart = ''
+      if [ ! -f "${varDir}/currentWebappDir" -o \
+          ! -f "${varDir}/currentKey" -o \
+          "${webappDir}" != "$(cat ${varDir}/currentWebappDir 2>/dev/null)" ] \
+          || ! sha512sum -c --status ${varDir}/currentKey; then
+        pushd ${webappDir} > /dev/null
+        /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod cache:clear
+        rm -rf /var/lib/wallabag/var/cache/pro_
+        /run/wrappers/bin/sudo -u wwwrun ./bin/console --env=prod doctrine:migrations:migrate --no-interaction
+        popd > /dev/null
+        echo -n "${webappDir}" > ${varDir}/currentWebappDir
+        sha512sum /var/secrets/webapps/tools-wallabag > ${varDir}/currentKey
+      fi
+    '';
     serviceDeps = [ "postgresql.service" "openldap.service" ];
     basedir = builtins.concatStringsSep ":" [ webappDir "/var/secrets/webapps/tools-wallabag" varDir ];
     socket = "/var/run/phpfpm/wallabag.sock";