Skip to content

Commit be0fda6

Browse files
committed
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.
1 parent a137aa3 commit be0fda6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ in
240240

241241
environment = {
242242
HOMEPAGE_CONFIG_DIR = configDir;
243-
HOMEPAGE_CACHE_DIR = "/var/cache/homepage-dashboard";
243+
NIXPKGS_HOMEPAGE_CACHE_DIR = "/var/cache/homepage-dashboard";
244244
PORT = toString cfg.listenPort;
245245
LOG_TARGETS = lib.mkIf managedConfig "stdout";
246246
};

pkgs/servers/homepage-dashboard/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ buildNpmPackage rec {
7676
# write its prerender cache.
7777
#
7878
# This patch ensures that the cache implementation respects the env
79-
# variable `HOMEPAGE_CACHE_DIR`, which is set by default in the
79+
# variable `NIXPKGS_HOMEPAGE_CACHE_DIR`, which is set by default in the
8080
# wrapper below.
8181
(cd "$out" && patch -p1 <${./prerender_cache_path.patch})
8282
8383
makeWrapper $out/share/homepage/server.js $out/bin/homepage \
8484
--set-default PORT 3000 \
8585
--set-default HOMEPAGE_CONFIG_DIR /var/lib/homepage-dashboard \
86-
--set-default HOMEPAGE_CACHE_DIR /var/cache/homepage-dashboard
86+
--set-default NIXPKGS_HOMEPAGE_CACHE_DIR /var/cache/homepage-dashboard
8787
8888
${if enableLocalIcons then installLocalIcons else ""}
8989

pkgs/servers/homepage-dashboard/prerender_cache_path.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ index b1b74d8..a46c80b 100644
1212
this.fs = ctx.fs;
1313
this.flushToDisk = ctx.flushToDisk;
1414
- this.serverDistDir = ctx.serverDistDir;
15-
+ this.serverDistDir = path.join(process.env.HOMEPAGE_CACHE_DIR, "homepage");
15+
+ this.serverDistDir = path.join(process.env.NIXPKGS_HOMEPAGE_CACHE_DIR, "homepage");
1616
this.appDir = !!ctx._appDir;
1717
if (ctx.maxMemoryCacheSize) {
1818
this.memoryCache = new _lruCache.default({

0 commit comments

Comments
 (0)