homepage-dashboard: prefix nixpkgs-specific env var with NIXPKGS_

I thought HOMEPAGE_CACHE_DIR was an upstream env var, and it confused me
a lot. Let's prefix it with NIXPKGS_ to make it clear that it's nixpkgs
specific.
This commit is contained in:
Bjørn Forsman
2025-01-06 18:18:57 +01:00
parent a137aa33cb
commit be0fda6511
3 changed files with 4 additions and 4 deletions
@@ -240,7 +240,7 @@ in
environment = {
HOMEPAGE_CONFIG_DIR = configDir;
HOMEPAGE_CACHE_DIR = "/var/cache/homepage-dashboard";
NIXPKGS_HOMEPAGE_CACHE_DIR = "/var/cache/homepage-dashboard";
PORT = toString cfg.listenPort;
LOG_TARGETS = lib.mkIf managedConfig "stdout";
};
+2 -2
View File
@@ -76,14 +76,14 @@ buildNpmPackage rec {
# write its prerender cache.
#
# This patch ensures that the cache implementation respects the env
# variable `HOMEPAGE_CACHE_DIR`, which is set by default in the
# variable `NIXPKGS_HOMEPAGE_CACHE_DIR`, which is set by default in the
# wrapper below.
(cd "$out" && patch -p1 <${./prerender_cache_path.patch})
makeWrapper $out/share/homepage/server.js $out/bin/homepage \
--set-default PORT 3000 \
--set-default HOMEPAGE_CONFIG_DIR /var/lib/homepage-dashboard \
--set-default HOMEPAGE_CACHE_DIR /var/cache/homepage-dashboard
--set-default NIXPKGS_HOMEPAGE_CACHE_DIR /var/cache/homepage-dashboard
${if enableLocalIcons then installLocalIcons else ""}
@@ -12,7 +12,7 @@ index b1b74d8..a46c80b 100644
this.fs = ctx.fs;
this.flushToDisk = ctx.flushToDisk;
- this.serverDistDir = ctx.serverDistDir;
+ this.serverDistDir = path.join(process.env.HOMEPAGE_CACHE_DIR, "homepage");
+ this.serverDistDir = path.join(process.env.NIXPKGS_HOMEPAGE_CACHE_DIR, "homepage");
this.appDir = !!ctx._appDir;
if (ctx.maxMemoryCacheSize) {
this.memoryCache = new _lruCache.default({