2023-11-03 17:08:37 +00:00
|
|
|
{ stdenv, autoPatchelfHook, fetchurl, nixosTests
|
2023-01-14 20:22:52 +00:00
|
|
|
, metaCommon }:
|
2023-01-14 19:28:01 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
serverSource.url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz";
|
2024-05-18 07:09:41 +00:00
|
|
|
serverSource.sha256 = "0gwp6h6nvfzq7k1g3233h838nans45jkd5c3pzl6qdhhm19vcs27";
|
|
|
|
version = "0.63.6";
|
2023-11-03 17:08:37 +00:00
|
|
|
in stdenv.mkDerivation {
|
2023-01-14 19:28:01 +00:00
|
|
|
pname = "trilium-server";
|
|
|
|
inherit version;
|
2023-01-14 20:22:52 +00:00
|
|
|
meta = metaCommon // {
|
2023-01-14 19:28:01 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|