about summary refs log tree commit diff
path: root/web/static/default.nix
blob: 7a17dec36279294e5fc7c0b5e3b3d7d5b1f2e135 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Expose all static assets as a folder. The derivation contains a
# `drvHash` attribute which can be used for cache-busting.
{ depot, lib, pkgs, ... }:

let
  storeDirLength = with builtins; (stringLength storeDir) + 1;
  logo = depot.web.tvl.logo;
in lib.fix(self: pkgs.runCommand "tvl-static" {
  passthru = {
    drvHash = lib.substring storeDirLength 32 self.drvPath;
  };
} ''
  mkdir $out
  cp -r ${./.}/* $out
  cp ${logo.pastelRainbow} $out/logo-animated.svg
  cp ${logo.redPng} $out/logo-red.png
'')