push
This commit is contained in:
1 parent
bcf05e8063
commit
f37985b4c8
109 files changed
+22810
-6143
No files matched your search
+42
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
# baked into <meta name="bug-tv-api" content="..."> of every top-level page
|
||||
apiBase ? "https://api-tv.bug.tools",
|
||||
}:
|
||||
|
||||
let
|
||||
sedExpr = ''s#(<meta[[:space:]]+name="bug-tv-api"[[:space:]]+content=")[^"]*(")#\1${
|
||||
lib.escape [ "\\" "&" "#" ] apiBase
|
||||
}\2#'';
|
||||
in
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "bug-tv-web";
|
||||
version = (lib.importJSON ../package.json).version;
|
||||
|
||||
src = ../web;
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
cp -r . $out
|
||||
chmod -R u+w $out
|
||||
# no-op on pages without the tag
|
||||
for page in $out/*.html; do
|
||||
sed -i -E ${lib.escapeShellArg sedExpr} "$page"
|
||||
done
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = { inherit apiBase; };
|
||||
|
||||
meta = {
|
||||
description = "bug.tv static web frontend (API: ${apiBase})";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user