Skip to content

Commit

Permalink
nixos/homepage-dashboard: fix stale cache issue
Browse files Browse the repository at this point in the history
When the cache is stale, homepage-dashboard serves bad data (UI lacks
styling etc.). This issue happens at least on homepage-dashboard version
upgrades.

Fixes #346016.

(cherry picked from commit 58f12ee)
  • Loading branch information
bjornfor committed Jan 6, 2025
1 parent 6f17a8c commit 772d5a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nixos/modules/services/misc/homepage-dashboard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ in
ExecStart = lib.getExe cfg.package;
Restart = "on-failure";
};

preStart = ''
# Related:
# * https://github.com/NixOS/nixpkgs/issues/346016 ("homepage-dashboard: cache dir is not cleared upon version upgrade")
# * https://github.com/gethomepage/homepage/discussions/4560 ("homepage NixOS package does not clear cache on upgrade leaving broken state")
# * https://github.com/vercel/next.js/discussions/58864 ("Feature Request: Allow configuration of cache dir")
rm -rf "$NIXPKGS_HOMEPAGE_CACHE_DIR"/*
'';
};

networking.firewall = lib.mkIf cfg.openFirewall {
Expand Down

0 comments on commit 772d5a2

Please sign in to comment.