Last active 1747736003

docs.nix Raw
1{
2 lib,
3 fetchFromGitHub,
4 stdenv,
5 fetchYarnDeps,
6 nodejs,
7 fixup-yarn-lock,
8 yarn,
9 yarnConfigHook,
10 makeWrapper,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "lasuite-docs-collaboration-server";
15 version = "3.2.1";
16
17 src = fetchFromGitHub {
18 owner = "suitenumerique";
19 repo = "docs";
20 tag = "v${version}";
21 hash = "sha256-jnt1YJgzkN8NmZGLO2/L4JUsHOoTJhOKvJdYDE5Vvfg=";
22 };
23
24 sourceRoot = "source/src/frontend";
25
26 offlineCache = fetchYarnDeps {
27 yarnLock = "${src}/src/frontend/yarn.lock";
28 hash = "sha256-JvgmyCNJk8c65wXDztEMC1+ZqHF7uQJyuw1ZDK7HQow=";
29 };
30
31 nativeBuildInputs = [
32 nodejs
33 fixup-yarn-lock
34 yarnConfigHook
35 yarn
36 makeWrapper
37 ];
38
39
40 buildPhase = ''
41 runHook preBuild
42
43 yarn --offline COLLABORATION_SERVER run build
44
45 runHook postBuild
46 '';
47
48 installPhase = ''
49 runHook preInstall
50
51 mkdir -p $out/{lib,bin}
52 cp -r {apps,node_modules,packages,servers} $out/lib
53
54 makeWrapper ${lib.getExe nodejs} "$out/bin/docs-collaboration-server" \
55 --add-flags "$out/lib/servers/y-provider/dist/start-server.js" --set NODE_PATH "$out/lib/node_modules"
56
57 runHook postInstall
58 '';
59
60 meta = {
61 description = "A collaborative note taking, wiki and documentation platform that scales. Built with Django and React. Opensource alternative to Notion or Outline";
62 homepage = "https://github.com/suitenumerique/docs";
63 changelog = "https://github.com/suitenumerique/docs/blob/${src.tag}/CHANGELOG.md";
64 mainProgram = "docs-collaboration-server";
65 license = lib.licenses.mit;
66 maintainers = with lib.maintainers; [ soyouzpanda ];
67 platforms = lib.platforms.all;
68 };
69}
70