docs.nix
· 1.6 KiB · Nix
Raw
{
lib,
fetchFromGitHub,
stdenv,
fetchYarnDeps,
nodejs,
fixup-yarn-lock,
yarn,
yarnConfigHook,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "lasuite-docs-collaboration-server";
version = "3.2.1";
src = fetchFromGitHub {
owner = "suitenumerique";
repo = "docs";
tag = "v${version}";
hash = "sha256-jnt1YJgzkN8NmZGLO2/L4JUsHOoTJhOKvJdYDE5Vvfg=";
};
sourceRoot = "source/src/frontend";
offlineCache = fetchYarnDeps {
yarnLock = "${src}/src/frontend/yarn.lock";
hash = "sha256-JvgmyCNJk8c65wXDztEMC1+ZqHF7uQJyuw1ZDK7HQow=";
};
nativeBuildInputs = [
nodejs
fixup-yarn-lock
yarnConfigHook
yarn
makeWrapper
];
buildPhase = ''
runHook preBuild
yarn --offline COLLABORATION_SERVER run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/{lib,bin}
cp -r {apps,node_modules,packages,servers} $out/lib
makeWrapper ${lib.getExe nodejs} "$out/bin/docs-collaboration-server" \
--add-flags "$out/lib/servers/y-provider/dist/start-server.js" --set NODE_PATH "$out/lib/node_modules"
runHook postInstall
'';
meta = {
description = "A collaborative note taking, wiki and documentation platform that scales. Built with Django and React. Opensource alternative to Notion or Outline";
homepage = "https://github.com/suitenumerique/docs";
changelog = "https://github.com/suitenumerique/docs/blob/${src.tag}/CHANGELOG.md";
mainProgram = "docs-collaboration-server";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ soyouzpanda ];
platforms = lib.platforms.all;
};
}
1 | { |
2 | lib, |
3 | fetchFromGitHub, |
4 | stdenv, |
5 | fetchYarnDeps, |
6 | nodejs, |
7 | fixup-yarn-lock, |
8 | yarn, |
9 | yarnConfigHook, |
10 | makeWrapper, |
11 | }: |
12 | |
13 | stdenv.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 |