nixpkgs/pkgs/applications/office/trilium/default.nix

67 lines
2 KiB
Nix
Raw Normal View History

2019-02-08 15:44:36 +01:00
{ stdenv, fetchurl, autoPatchelfHook, atomEnv, makeWrapper, makeDesktopItem, gtk3, wrapGAppsHook }:
2018-12-30 23:20:50 +01:00
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";
};
in stdenv.mkDerivation rec {
name = "trilium-${version}";
2019-06-04 22:18:08 +02:00
version = "0.32.3";
src = fetchurl {
url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz";
2019-06-04 22:18:08 +02:00
sha256 = "0xjdr20fbqs2gcxpvi1b48qgix9nhl06pd7ypg6wgfa4rqmg9ha5";
};
# Fetch from source repo, no longer included in release.
# (they did special-case icon.png but we want the scalable svg)
# Use the version here to ensure we get any changes.
trilium_svg = fetchurl {
url = "https://raw.githubusercontent.com/zadam/trilium/v${version}/src/public/images/trilium.svg";
sha256 = "1rgj7pza20yndfp8n12k93jyprym02hqah36fkk2b3if3kcmwnfg";
};
2018-12-30 23:20:50 +01:00
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
2019-02-08 15:44:36 +01:00
wrapGAppsHook
2018-12-30 23:20:50 +01:00
];
2019-02-08 15:44:36 +01:00
buildInputs = [ atomEnv.packages gtk3 ];
2018-12-30 23:20:50 +01:00
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/trilium
mkdir -p $out/share/{applications,icons/hicolor/scalable/apps}
cp -r ./* $out/share/trilium
ln -s $out/share/trilium/trilium $out/bin/trilium
ln -s ${trilium_svg} $out/share/icons/hicolor/scalable/apps/trilium.svg
2018-12-30 23:20:50 +01:00
cp ${desktopItem}/share/applications/* $out/share/applications
'';
2019-02-08 15:44:36 +01:00
# LD_LIBRARY_PATH "shouldn't" be needed, remove when possible :)
2018-12-30 23:20:50 +01:00
preFixup = ''
2019-02-08 15:44:36 +01:00
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${atomEnv.libPath})
2018-12-30 23:20:50 +01:00
'';
dontStrip = true;
meta = with stdenv.lib; {
inherit description;
homepage = https://github.com/zadam/trilium;
license = licenses.agpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ emmanuelrosa dtzWill ];
};
}