diff --git a/modules/fireflyIII.nix b/modules/fireflyIII.nix index 9af3dbf..b1eb9e1 100644 --- a/modules/fireflyIII.nix +++ b/modules/fireflyIII.nix @@ -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"; diff --git a/pkgs/firefly-iii.nix b/pkgs/firefly-iii.nix index 905311f..6d4de79 100644 --- a/pkgs/firefly-iii.nix +++ b/pkgs/firefly-iii.nix @@ -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; {