2021-10-01 00:21:13 +02:00
|
|
|
# Expose all static assets as a folder. The derivation contains a
|
|
|
|
# `drvHash` attribute which can be used for cache-busting.
|
|
|
|
{ depot, lib, pkgs, ... }:
|
2021-08-26 19:28:06 +02:00
|
|
|
|
2021-10-01 01:12:07 +02:00
|
|
|
let
|
|
|
|
storeDirLength = with builtins; (stringLength storeDir) + 1;
|
|
|
|
logo = depot.web.tvl.logo;
|
2021-10-01 00:21:13 +02:00
|
|
|
in lib.fix(self: pkgs.runCommand "tvl-static" {
|
|
|
|
passthru = {
|
2021-11-13 13:43:43 +01:00
|
|
|
# Preserving the string context here makes little sense: While we are
|
|
|
|
# referencing this derivation, we are not doing so via the nix store,
|
|
|
|
# so it makes little sense for Nix to police the references.
|
|
|
|
drvHash = builtins.unsafeDiscardStringContext (
|
|
|
|
lib.substring storeDirLength 32 self.drvPath
|
|
|
|
);
|
2021-10-01 00:21:13 +02:00
|
|
|
};
|
|
|
|
} ''
|
2021-10-01 01:12:07 +02:00
|
|
|
mkdir $out
|
|
|
|
cp -r ${./.}/* $out
|
|
|
|
cp ${logo.pastelRainbow} $out/logo-animated.svg
|
|
|
|
cp ${logo.redPng} $out/logo-red.png
|
2021-10-01 00:21:13 +02:00
|
|
|
'')
|