{ stdenv, autoPatchelfHook, fetchurl, nixosTests , metaCommon }: let serverSource.url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz"; serverSource.sha256 = "02kd7gm93nmxsxy1bx5kac7jizslik9nlfcnq8kn6mprfcv8anfn"; version = "0.63.5"; in stdenv.mkDerivation { 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 <