nixpkgs/pkgs/servers/web-apps/outline/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
2.0 KiB
Nix
Raw Normal View History

2022-02-16 11:02:44 +00:00
{ stdenv
, lib
, fetchFromGitHub
2023-09-06 03:01:55 +00:00
, fetchYarnDeps
2022-02-16 11:02:44 +00:00
, makeWrapper
, nodejs
, yarn
, yarn2nix-moretea
2023-05-17 11:10:57 +00:00
, nixosTests
2022-02-16 11:02:44 +00:00
}:
stdenv.mkDerivation rec {
pname = "outline";
2023-08-29 11:32:19 +00:00
version = "0.71.0";
2022-02-16 11:02:44 +00:00
src = fetchFromGitHub {
owner = "outline";
repo = "outline";
rev = "v${version}";
2023-08-29 11:32:19 +00:00
hash = "sha256-vwYq5b+cMYf/gnpCwLEpErYKqYw/RwcvyBjhp+5+bTY=";
2022-02-16 11:02:44 +00:00
};
nativeBuildInputs = [ makeWrapper yarn2nix-moretea.fixup_yarn_lock ];
buildInputs = [ yarn nodejs ];
2023-09-06 03:01:55 +00:00
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-j9iaxXfMlG9dT6fvYgPQg6Y0QvCRiBU1peO0YgsGHOY=";
};
2022-02-16 11:02:44 +00:00
configurePhase = ''
export HOME=$(mktemp -d)/yarn_home
'';
buildPhase = ''
runHook preBuild
export NODE_OPTIONS=--openssl-legacy-provider
2022-02-16 11:02:44 +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/
2023-05-16 12:55:33 +00:00
# apply upstream patches with `patch-package`
yarn run postinstall
2022-02-16 11:02:44 +00:00
yarn build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/outline
2023-05-16 12:55:33 +00:00
mv build server public node_modules $out/share/outline/
node_modules=$out/share/outline/node_modules
build=$out/share/outline/build
2023-05-16 12:55:33 +00:00
server=$out/share/outline/server
2022-02-16 11:02:44 +00:00
makeWrapper ${nodejs}/bin/node $out/bin/outline-server \
--add-flags $build/server/index.js \
--set NODE_ENV production \
--set NODE_PATH $node_modules
runHook postInstall
'';
2023-05-17 11:10:57 +00:00
passthru.tests = {
basic-functionality = nixosTests.outline;
};
2022-02-16 11:02:44 +00:00
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;
2023-05-21 13:34:42 +00:00
maintainers = with maintainers; [ cab404 yrd xanderio ];
2022-02-16 11:02:44 +00:00
platforms = platforms.linux;
};
}