···115115 user = "grocy";
116116 group = "nginx";
117117118118- # PHP 8.1 is the only version which is supported/tested by upstream:
119119- # https://github.com/grocy/grocy/blob/v4.0.0/README.md#platform-support
120120- phpPackage = pkgs.php81;
118118+ # PHP 8.1 and 8.2 are the only version which are supported/tested by upstream:
119119+ # https://github.com/grocy/grocy/blob/v4.0.2/README.md#platform-support
120120+ phpPackage = pkgs.php82;
121121122122 inherit (cfg.phpfpm) settings;
123123···128128 GROCY_PLUGIN_DIR = "${cfg.dataDir}/plugins";
129129 GROCY_CACHE_DIR = "${cfg.dataDir}/viewcache";
130130 };
131131+ };
132132+133133+ # After an update of grocy, the viewcache needs to be deleted. Otherwise grocy will not work
134134+ # https://github.com/grocy/grocy#how-to-update
135135+ systemd.services.grocy-setup = {
136136+ wantedBy = [ "multi-user.target" ];
137137+ before = [ "phpfpm-grocy.service" ];
138138+ script = ''
139139+ rm -rf ${cfg.dataDir}/viewcache/*
140140+ '';
131141 };
132142133143 services.nginx = {