~james/core

core/nix/pkgs/docs.nix -rw-r--r-- 811 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  buildNpmPackage,
  src,
  web-static-files,
}:
buildNpmPackage {
  pname = "tangled-docs";
  version = "0.0.1";

  inherit src;
  sourceRoot = "${src.name}/docs";

  npmDepsHash = "sha256-wEX2Y2r97d/1ycKknUbL5ea/PuDSwIO/hFGdULtG9KU=";

  env.ASTRO_TELEMETRY_DISABLED = "1";

  # same self-hosted fonts as the web app (web/src/fonts.css)
  preBuild = ''
    mkdir -p public/fonts
    cp -f ${web-static-files}/fonts/* public/fonts/

    # web/tsconfig.json extends this file, which svelte-kit sync writes in a dev checkout
    chmod u+w ../web
    mkdir -p '../web/node_modules/$app'
    echo '{"compilerOptions":{"target":"esnext","verbatimModuleSyntax":true}}' > '../web/node_modules/$app/tsconfig.json'
  '';

  installPhase = ''
    runHook preInstall
    cp -r dist $out
    runHook postInstall
  '';
}