From d636fc577b782426df12e974ac3b78744cd1cbbc Mon Sep 17 00:00:00 2001 From: BeatLink Date: Mon, 25 Aug 2025 22:17:39 -0500 Subject: [PATCH] trillium-{desktop,server}: 0.97.2 -> 0.98.0 --- ...sole-logger-instead-of-rolling-files.patch | 72 ----------- pkgs/applications/office/trilium/default.nix | 21 ---- pkgs/applications/office/trilium/desktop.nix | 113 ------------------ pkgs/applications/office/trilium/server.nix | 65 ---------- pkgs/applications/office/trilium/update.sh | 23 ---- .../package.nix | 32 ++--- pkgs/by-name/tr/trilium-desktop/update.sh | 29 +++++ .../by-name/tr/trilium-next-desktop/update.sh | 29 ----- .../package.nix | 10 +- pkgs/top-level/all-packages.nix | 5 - 10 files changed, 50 insertions(+), 349 deletions(-) delete mode 100644 pkgs/applications/office/trilium/0001-Use-console-logger-instead-of-rolling-files.patch delete mode 100644 pkgs/applications/office/trilium/default.nix delete mode 100644 pkgs/applications/office/trilium/desktop.nix delete mode 100644 pkgs/applications/office/trilium/server.nix delete mode 100755 pkgs/applications/office/trilium/update.sh rename pkgs/by-name/tr/{trilium-next-desktop => trilium-desktop}/package.nix (77%) create mode 100755 pkgs/by-name/tr/trilium-desktop/update.sh delete mode 100755 pkgs/by-name/tr/trilium-next-desktop/update.sh rename pkgs/by-name/tr/{trilium-next-server => trilium-server}/package.nix (87%) diff --git a/pkgs/applications/office/trilium/0001-Use-console-logger-instead-of-rolling-files.patch b/pkgs/applications/office/trilium/0001-Use-console-logger-instead-of-rolling-files.patch deleted file mode 100644 index 68f203b464b2..000000000000 --- a/pkgs/applications/office/trilium/0001-Use-console-logger-instead-of-rolling-files.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/src/services/log.js b/src/services/log.js -index a141eae14..094b9381b 100644 ---- a/src/services/log.js -+++ b/src/services/log.js -@@ -1,15 +1,7 @@ - "use strict"; - --const fs = require('fs'); --const dataDir = require('./data_dir.js'); - const cls = require('./cls.js'); - --if (!fs.existsSync(dataDir.LOG_DIR)) { -- fs.mkdirSync(dataDir.LOG_DIR, 0o700); --} -- --let logFile = null; -- - const SECOND = 1000; - const MINUTE = 60 * SECOND; - const HOUR = 60 * MINUTE; -@@ -17,38 +9,6 @@ const DAY = 24 * HOUR; - - const NEW_LINE = process.platform === "win32" ? '\r\n' : '\n'; - --let todaysMidnight = null; -- --initLogFile(); -- --function getTodaysMidnight() { -- const now = new Date(); -- -- return new Date(now.getFullYear(), now.getMonth(), now.getDate()); --} -- --function initLogFile() { -- todaysMidnight = getTodaysMidnight(); -- -- const path = `${dataDir.LOG_DIR}/trilium-${formatDate()}.log`; -- -- if (logFile) { -- logFile.end(); -- } -- -- logFile = fs.createWriteStream(path, {flags: 'a'}); --} -- --function checkDate(millisSinceMidnight) { -- if (millisSinceMidnight >= DAY) { -- initLogFile(); -- -- millisSinceMidnight -= DAY; -- } -- -- return millisSinceMidnight; --} -- - function log(str) { - const bundleNoteId = cls.get("bundleNoteId"); - -@@ -56,12 +16,6 @@ function log(str) { - str = `[Script ${bundleNoteId}] ${str}`; - } - -- let millisSinceMidnight = Date.now() - todaysMidnight.getTime(); -- -- millisSinceMidnight = checkDate(millisSinceMidnight); -- -- logFile.write(`${formatTime(millisSinceMidnight)} ${str}${NEW_LINE}`); -- - console.log(str); - } - \ No newline at end of file diff --git a/pkgs/applications/office/trilium/default.nix b/pkgs/applications/office/trilium/default.nix deleted file mode 100644 index b910e548ba6f..000000000000 --- a/pkgs/applications/office/trilium/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ lib, callPackage, ... }: - -let - metaCommon = with lib; { - description = "Hierarchical note taking application with focus on building large personal knowledge bases"; - homepage = "https://github.com/zadam/trilium"; - license = licenses.agpl3Plus; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - platforms = [ "x86_64-linux" ]; - maintainers = with maintainers; [ - fliegendewurst - eliandoran - ]; - }; -in -{ - - trilium-desktop = callPackage ./desktop.nix { metaCommon = metaCommon; }; - trilium-server = callPackage ./server.nix { metaCommon = metaCommon; }; - -} diff --git a/pkgs/applications/office/trilium/desktop.nix b/pkgs/applications/office/trilium/desktop.nix deleted file mode 100644 index 2a812f6d00b7..000000000000 --- a/pkgs/applications/office/trilium/desktop.nix +++ /dev/null @@ -1,113 +0,0 @@ -{ - stdenv, - lib, - unzip, - autoPatchelfHook, - fetchurl, - makeWrapper, - alsa-lib, - libgbm, - nss, - nspr, - systemd, - makeDesktopItem, - copyDesktopItems, - wrapGAppsHook3, - metaCommon, -}: - -let - pname = "trilium-desktop"; - version = "0.63.6"; - - linuxSource.url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz"; - linuxSource.sha256 = "12kgq5x4f93hxz057zqhz0x1y0rxfxh90fv9fjjs3jrnk0by7f33"; - - darwinSource.url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-mac-x64-${version}.zip"; - darwinSource.sha256 = "0ry512cn622av3nm8rnma2yvqc71rpzax639872ivvc5vm4rsc30"; - - meta = metaCommon // { - mainProgram = "trilium"; - platforms = [ - "x86_64-linux" - "x86_64-darwin" - ]; - }; - - linux = stdenv.mkDerivation rec { - inherit pname version meta; - - src = fetchurl linuxSource; - - # TODO: migrate off autoPatchelfHook and use nixpkgs' electron - nativeBuildInputs = [ - autoPatchelfHook - makeWrapper - wrapGAppsHook3 - copyDesktopItems - ]; - - buildInputs = [ - alsa-lib - libgbm - nss - nspr - stdenv.cc.cc - systemd - ]; - - desktopItems = [ - (makeDesktopItem { - name = "Trilium"; - exec = "trilium"; - icon = "trilium"; - comment = meta.description; - desktopName = "Trilium Notes"; - categories = [ "Office" ]; - startupWMClass = "trilium notes"; - }) - ]; - - # Remove trilium-portable.sh, so trilium knows it is packaged making it stop auto generating a desktop item on launch - postPatch = '' - rm ./trilium-portable.sh - ''; - - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $out/share/trilium - mkdir -p $out/share/icons/hicolor/128x128/apps - - cp -r ./* $out/share/trilium - ln -s $out/share/trilium/trilium $out/bin/trilium - - ln -s $out/share/trilium/icon.png $out/share/icons/hicolor/128x128/apps/trilium.png - runHook postInstall - ''; - - # LD_LIBRARY_PATH "shouldn't" be needed, remove when possible :) - # Error: libstdc++.so.6: cannot open shared object file: No such file or directory - preFixup = '' - gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs}) - ''; - - dontStrip = true; - - passthru.updateScript = ./update.sh; - }; - - darwin = stdenv.mkDerivation { - inherit pname version meta; - - src = fetchurl darwinSource; - nativeBuildInputs = [ unzip ]; - - installPhase = '' - mkdir -p $out/Applications - cp -r *.app $out/Applications - ''; - }; - -in -if stdenv.hostPlatform.isDarwin then darwin else linux diff --git a/pkgs/applications/office/trilium/server.nix b/pkgs/applications/office/trilium/server.nix deleted file mode 100644 index 4b1770dbd3d8..000000000000 --- a/pkgs/applications/office/trilium/server.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - lib, - 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 = "0gwp6h6nvfzq7k1g3233h838nans45jkd5c3pzl6qdhhm19vcs27"; - version = "0.63.6"; -in -stdenv.mkDerivation { - pname = "trilium-server"; - inherit version; - meta = metaCommon // { - platforms = [ "x86_64-linux" ]; - mainProgram = "trilium-server"; - }; - - src = fetchurl serverSource; - - nativeBuildInputs = [ - autoPatchelfHook - ]; - - buildInputs = [ - (lib.getLib stdenv.cc.cc) - ]; - - 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 <