2022-09-09 14:08:57 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, nodejs
|
|
|
|
, yarn
|
|
|
|
, yarn2nix-moretea
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "outline";
|
2022-11-27 09:42:12 +00:00
|
|
|
version = "0.67.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "outline";
|
|
|
|
repo = "outline";
|
|
|
|
rev = "v${version}";
|
2022-11-27 09:42:12 +00:00
|
|
|
sha256 = "l7EJkmH/ctP8P937bV5gUqmeKeuH2mjby7Mj/USaCcA=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper yarn2nix-moretea.fixup_yarn_lock ];
|
|
|
|
buildInputs = [ yarn nodejs ];
|
|
|
|
|
|
|
|
# Replace the inline call to yarn with our sequalize wrapper. This should be
|
|
|
|
# the only occurrence:
|
|
|
|
# https://github.com/outline/outline/search?l=TypeScript&q=yarn
|
|
|
|
patches = [ ./sequelize-command.patch ];
|
|
|
|
|
|
|
|
yarnOfflineCache = yarn2nix-moretea.importOfflineCache ./yarn.nix;
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
export HOME=$(mktemp -d)/yarn_home
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2022-10-21 18:38:19 +00:00
|
|
|
export NODE_OPTIONS=--openssl-legacy-provider
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
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/
|
|
|
|
yarn build
|
|
|
|
|
|
|
|
pushd server
|
|
|
|
cp -r config migrations onboarding ../build/server/
|
|
|
|
popd
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin $out/share/outline
|
2022-11-21 17:40:18 +00:00
|
|
|
mv public node_modules build $out/share/outline/
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
node_modules=$out/share/outline/node_modules
|
|
|
|
build=$out/share/outline/build
|
|
|
|
|
|
|
|
makeWrapper ${nodejs}/bin/node $out/bin/outline-server \
|
|
|
|
--add-flags $build/server/index.js \
|
|
|
|
--set NODE_ENV production \
|
|
|
|
--set NODE_PATH $node_modules
|
|
|
|
|
|
|
|
makeWrapper ${nodejs}/bin/node $out/bin/outline-sequelize \
|
|
|
|
--add-flags $node_modules/.bin/sequelize \
|
|
|
|
--add-flags "--migrations-path $build/server/migrations" \
|
|
|
|
--add-flags "--models-path $build/server/models" \
|
|
|
|
--add-flags "--seeders-path $build/server/models/fixtures" \
|
|
|
|
--set NODE_ENV production \
|
|
|
|
--set NODE_PATH $node_modules
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The 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 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|