blob: 089cd5a0c56d7f6bd0c5310e8af08c1212668c2b (
plain) (
blame)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
{ stdenv
, lib
, fetchFromGitHub
, fetchYarnDeps
, makeWrapper
, prefetch-yarn-deps
, fixup-yarn-lock
, nodejs
, yarn
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "outline";
version = "0.77.1";
src = fetchFromGitHub {
owner = "outline";
repo = "outline";
rev = "v${version}";
hash = "sha256-n2TGbCRe/NSX+4lSmLGs2WUh44s+Hr6eblsqnzYNeSs=";
};
nativeBuildInputs = [ makeWrapper prefetch-yarn-deps fixup-yarn-lock ];
buildInputs = [ yarn nodejs ];
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-wxXnvi58mBfAQiMSxhXWK7sYLvr8nfQ+u6kMYnRWI3s=";
};
configurePhase = ''
export HOME=$(mktemp -d)/yarn_home
'';
buildPhase = ''
runHook preBuild
export NODE_OPTIONS=--openssl-legacy-provider
yarn config --offline set yarn-offline-mirror $yarnOfflineCache
fixup-yarn-lock yarn.lock
yarn install --offline \
--frozen-lockfile \
--ignore-engines --ignore-scripts
patchShebangs node_modules/
# apply upstream patches with `patch-package`
yarn run postinstall
yarn build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/outline
mv build server public node_modules $out/share/outline/
node_modules=$out/share/outline/node_modules
build=$out/share/outline/build
server=$out/share/outline/server
makeWrapper ${nodejs}/bin/node $out/bin/outline-server \
--add-flags $build/server/index.js \
--set NODE_ENV production \
--set NODE_PATH $node_modules \
--prefix PATH : ${lib.makeBinPath [ nodejs ]} # required to run migrations
runHook postInstall
'';
passthru.tests = {
basic-functionality = nixosTests.outline;
};
meta = with lib; {
description = "Fastest wiki and knowledge base for growing teams. Beautiful, feature rich, and markdown compatible";
homepage = "https://www.getoutline.com/";
changelog = "https://github.com/outline/outline/releases";
license = licenses.bsl11;
maintainers = with maintainers; [ cab404 yrd xanderio ];
platforms = platforms.linux;
};
}
|