about summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorEmber Keske <git@n0emis.eu>2023-08-19 19:45:28 +0200
committerEmber Keske <git@n0emis.eu>2023-08-21 10:36:24 +0200
commit0138e327c1e3f879c22c54614476514705c04d54 (patch)
tree2328c469ee1601ea967fe6edf12ec71abb3962b9 /nixos/modules/services
parent0b1ef8ea9e8b5c35e1d48a88f6cff506a6ba432e (diff)
downloadnixlib-0138e327c1e3f879c22c54614476514705c04d54.tar
nixlib-0138e327c1e3f879c22c54614476514705c04d54.tar.gz
nixlib-0138e327c1e3f879c22c54614476514705c04d54.tar.bz2
nixlib-0138e327c1e3f879c22c54614476514705c04d54.tar.lz
nixlib-0138e327c1e3f879c22c54614476514705c04d54.tar.xz
nixlib-0138e327c1e3f879c22c54614476514705c04d54.tar.zst
nixlib-0138e327c1e3f879c22c54614476514705c04d54.zip
grocy: clear viewcache before start
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/web-apps/grocy.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/web-apps/grocy.nix b/nixos/modules/services/web-apps/grocy.nix
index d4b1a892867f..4d1084e295ff 100644
--- a/nixos/modules/services/web-apps/grocy.nix
+++ b/nixos/modules/services/web-apps/grocy.nix
@@ -130,6 +130,16 @@ in {
       };
     };
 
+    # After an update of grocy, the viewcache needs to be deleted. Otherwise grocy will not work
+    # https://github.com/grocy/grocy#how-to-update
+    systemd.services.grocy-setup = {
+      wantedBy = [ "multi-user.target" ];
+      before = [ "phpfpm-grocy.service" ];
+      script = ''
+        rm -rf ${cfg.dataDir}/viewcache/*
+      '';
+    };
+
     services.nginx = {
       enable = true;
       virtualHosts."${cfg.hostName}" = mkMerge [