1 { lib, stdenv, grocy }:
6 varDir = "/var/lib/grocy";
10 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir}/data
11 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
14 webRoot = grocy.webRoot;
18 modules = [ "proxy_fcgi" ];
19 webappName = "tools_grocy";
20 root = "/run/current-system/webapps/${webappName}";
21 vhostConf = socket: ''
22 Alias /grocy "${root}"
24 DirectoryIndex index.php
26 SetHandler "proxy:unix:${socket}|fcgi://localhost"
30 Options +FollowSymlinks
36 basedir = builtins.concatStringsSep ":" (
37 [ grocy grocy.yarnModules varDir ]);
39 "listen.owner" = apache.user;
40 "listen.group" = apache.group;
42 "pm.max_children" = "60";
43 "pm.process_idle_timeout" = "60";
45 # Needed to avoid clashes in browser cookies (same domain)
46 "php_value[session.name]" = "grocyPHPSESSID";
47 "php_admin_value[open_basedir]" = "${basedir}:/tmp";
48 "php_admin_value[session.save_path]" = "${varDir}/phpSessions";