Commit 58f12ee8 authored by Bjørn Forsman's avatar Bjørn Forsman
Browse files

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 https://github.com/NixOS/nixpkgs/issues/346016.
parent 55d28df0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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 {