about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--web/static/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/web/static/default.nix b/web/static/default.nix
index 518f21d6f9..ef346f9c74 100644
--- a/web/static/default.nix
+++ b/web/static/default.nix
@@ -1,6 +1,12 @@
-{ pkgs, ... }:
+# Expose all static assets as a folder. The derivation contains a
+# `drvHash` attribute which can be used for cache-busting.
+{ depot, lib, pkgs, ... }:
 
-# Needs to be a derivation ...
-pkgs.runCommand "tvl-static" {} ''
+let storeDirLength = with builtins; (stringLength storeDir) + 1;
+in lib.fix(self: pkgs.runCommand "tvl-static" {
+  passthru = {
+    drvHash = lib.substring storeDirLength 32 self.drvPath;
+  };
+} ''
   cp -r ${./.} $out
-''
+'')