fix: firefly now without copying

This commit is contained in:
Patrick 2024-04-05 14:17:29 +02:00
parent d7b649395c
commit 22b78d1840
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
2 changed files with 8 additions and 11 deletions

View file

@ -116,17 +116,14 @@ in {
Type = "oneshot";
RemainAfterExit = true;
User = "firefly-iii";
WorkingDirectory = cfg.dataDir;
WorkingDirectory = package;
};
script = ''
set -euo pipefail
umask 077
cp -f -r ${package}/* ${cfg.dataDir}
find ${cfg.dataDir} -perm 400 -exec chmod 444 {} \;
find ${cfg.dataDir} -perm 500 -exec chmod 555 {} \;
${lib.optionalString cfg.dbCreateLocally ''
mkdir -p ${cfg.dataDir}/storage/database/
touch ${cfg.dataDir}/storage/database/database.sqlite
mkdir -p ${package}/storage/database/
touch ${package}/storage/database/database.sqlite
''}
# migrate db
@ -161,7 +158,7 @@ in {
recommendedOptimisation = mkDefault true;
recommendedGzipSettings = mkDefault true;
virtualHosts.${cfg.virtualHost} = {
root = "${cfg.dataDir}/public";
root = "${package}/public";
locations = {
"/" = {
tryFiles = "$uri $uri/ /index.php?$query_string";

View file

@ -17,10 +17,10 @@ in
installPhase = ''
mkdir -p $out/storage
cp -r ./ $out
rm -R $out/storage
#ln -fs ${dataDir}/storage $out/storage
#ln -fs ${dataDir}/bootstrap/cache $out/bootstrap/cache
#ln -fs ${dataDir}/.env $out/.env
rm -Rf $out/storage
ln -fs ${dataDir}/storage $out/storage
rm -Rf $out/bootstrap/cache
ln -fs ${dataDir}/bootstrap/cache $out/bootstrap/cache
'';
meta = with lib; {