2023-02-02 18:25:31 +00:00
|
|
|
{ stdenv, lib, autoPatchelfHook, fetchurl, nixosTests
|
|
|
|
, metaCommon }:
|
|
|
|
|
|
|
|
let
|
|
|
|
serverSource.url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz";
|
2023-03-04 12:14:45 +00:00
|
|
|
serverSource.sha256 = "073hxqszd6sh2fcczs8c1sgby0pg97d3h99rjdrj7y2j85hflp5a";
|
|
|
|
version = "0.59.1";
|
2023-02-02 18:25:31 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "trilium-server";
|
|
|
|
inherit version;
|
|
|
|
meta = metaCommon // {
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl serverSource;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# patch logger to use console instead of rolling files
|
|
|
|
./0001-Use-console-logger-instead-of-rolling-files.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/trilium-server
|
|
|
|
|
|
|
|
cp -r ./* $out/share/trilium-server
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
cat > $out/bin/trilium-server <<EOF
|
|
|
|
#!${stdenv.cc.shell}
|
|
|
|
cd $out/share/trilium-server
|
|
|
|
exec ./node/bin/node src/www
|
|
|
|
EOF
|
|
|
|
chmod a+x $out/bin/trilium-server
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
trilium-server = nixosTests.trilium-server;
|
|
|
|
};
|
|
|
|
}
|