trilium: 0.51.2 -> 0.53.2 + update script (#177484)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
FliegendeWurst 2022-08-02 14:01:17 +02:00 committed by GitHub
parent 792d5a34ca
commit 48f4befd44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 27 deletions

View file

@ -10,6 +10,7 @@ let
# Disable automatically generating desktop icon
noDesktopIcon=true
noBackup=${lib.boolToString cfg.noBackup}
noAuthentication=${lib.boolToString cfg.noAuthentication}
[Network]
# host setting is relevant only for web deployments - set the host on which the server will listen
@ -49,6 +50,14 @@ in
'';
};
noAuthentication = mkOption {
type = types.bool;
default = false;
description = ''
If set to true, no password is required to access the web frontend.
'';
};
host = mkOption {
type = types.str;
default = "127.0.0.1";

View file

@ -1,18 +1,8 @@
{ lib, stdenv, nixosTests, fetchurl, autoPatchelfHook, atomEnv, makeWrapper, makeDesktopItem, gtk3, libxshmfence, wrapGAppsHook }:
{ lib, stdenv, nixosTests, fetchurl, autoPatchelfHook, atomEnv, makeWrapper, makeDesktopItem, copyDesktopItems, libxshmfence, wrapGAppsHook }:
let
description = "Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases";
desktopItem = makeDesktopItem {
name = "Trilium";
exec = "trilium";
icon = "trilium";
comment = description;
desktopName = "Trilium Notes";
categories = [ "Office" ];
};
meta = with lib; {
inherit description;
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 ];
@ -20,24 +10,22 @@ let
maintainers = with maintainers; [ fliegendewurst ];
};
version = "0.51.2";
version = "0.53.2";
desktopSource = {
url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz";
sha256 = "17bqcnpvflpi5dlz9m294diwd6as5wha5jcv9a3qvhh4pq0nyr4z";
};
desktopSource.url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz";
desktopSource.sha256 = "0sjljyn7x0kv1692wccdjsll8h49r9lyqbrfnz4cn147xinclyw4";
serverSource = {
url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz";
sha256 = "0jjvg75a4va5d81x8dvpzmzax7p0bqd7psv0alkkl13m91gai6ig";
};
serverSource.url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz";
serverSource.sha256 = "0y5xjf4r0c2hw2ch4ml55fq1nlmgnakq4zh3ch8sdgzm86nchavb";
in {
trilium-desktop = stdenv.mkDerivation rec {
pname = "trilium-desktop";
inherit version;
inherit meta;
meta = metaCommon // {
mainProgram = "trilium";
};
src = fetchurl desktopSource;
@ -45,21 +33,32 @@ in {
autoPatchelfHook
makeWrapper
wrapGAppsHook
copyDesktopItems
];
buildInputs = atomEnv.packages ++ [ gtk3 libxshmfence ];
buildInputs = atomEnv.packages ++ [ libxshmfence ];
desktopItems = [
(makeDesktopItem {
name = "Trilium";
exec = "trilium";
icon = "trilium";
comment = meta.description;
desktopName = "Trilium Notes";
categories = [ "Office" ];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share/trilium
mkdir -p $out/share/{applications,icons/hicolor/128x128/apps}
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
cp ${desktopItem}/share/applications/* $out/share/applications
runHook postInstall
'';
@ -69,13 +68,15 @@ in {
'';
dontStrip = true;
passthru.updateScript = ./update.sh;
};
trilium-server = stdenv.mkDerivation rec {
pname = "trilium-server";
inherit version;
inherit meta;
meta = metaCommon;
src = fetchurl serverSource;

View file

@ -0,0 +1,18 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils curl jq
set -euo pipefail
cd $(dirname "${BASH_SOURCE[0]}")
version=$(curl -s --show-error "https://api.github.com/repos/zadam/trilium/releases/latest" | jq -r '.tag_name' | tail -c +2)
sha256_linux64=$(nix-prefetch-url --quiet https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz)
sha256_linux64_server=$(nix-prefetch-url --quiet https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz)
setKV () {
sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" ./default.nix
}
setKV version $version
setKV desktopSource.sha256 $sha256_linux64
setKV serverSource.sha256 $sha256_linux64_server