Skip to content

Commit 58f12ee

Browse files
committed
nixos/homepage-dashboard: fix stale cache issue
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 NixOS#346016.
1 parent 55d28df commit 58f12ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nixos/modules/services/misc/homepage-dashboard.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ in
254254
ExecStart = lib.getExe cfg.package;
255255
Restart = "on-failure";
256256
};
257+
258+
preStart = ''
259+
# Related:
260+
# * https://github.com/NixOS/nixpkgs/issues/346016 ("homepage-dashboard: cache dir is not cleared upon version upgrade")
261+
# * https://github.com/gethomepage/homepage/discussions/4560 ("homepage NixOS package does not clear cache on upgrade leaving broken state")
262+
# * https://github.com/vercel/next.js/discussions/58864 ("Feature Request: Allow configuration of cache dir")
263+
rm -rf "$NIXPKGS_HOMEPAGE_CACHE_DIR"/*
264+
'';
257265
};
258266

259267
networking.firewall = lib.mkIf cfg.openFirewall {

0 commit comments

Comments
 (0)