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

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.
parent a137aa33
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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 ""}

+1 −1
Original line number Diff line number Diff line
@@ -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({