summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorChristian Kampka <christian@kampka.net>2019-12-05 14:07:17 +0100
committerChristian Kampka <christian@kampka.net>2019-12-19 10:14:10 +0100
commita84c8599b305021891b4bc44f9ae8fceedc2c663 (patch)
tree819cbe3f6063dd4414c248afc2f4b55b610a5de5 /pkgs/applications/office
parent184339fe8b3b5218aa5203b587065d48a99fafb7 (diff)
downloadnixpkgs-a84c8599b305021891b4bc44f9ae8fceedc2c663.tar
nixpkgs-a84c8599b305021891b4bc44f9ae8fceedc2c663.tar.gz
nixpkgs-a84c8599b305021891b4bc44f9ae8fceedc2c663.tar.bz2
nixpkgs-a84c8599b305021891b4bc44f9ae8fceedc2c663.tar.lz
nixpkgs-a84c8599b305021891b4bc44f9ae8fceedc2c663.tar.xz
nixpkgs-a84c8599b305021891b4bc44f9ae8fceedc2c663.tar.zst
nixpkgs-a84c8599b305021891b4bc44f9ae8fceedc2c663.zip
trilium-server: init at 0.37.8
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/trilium/default.nix55
1 files changed, 47 insertions, 8 deletions
diff --git a/pkgs/applications/office/trilium/default.nix b/pkgs/applications/office/trilium/default.nix
index 84e351b9d42..ed6715e50f8 100644
--- a/pkgs/applications/office/trilium/default.nix
+++ b/pkgs/applications/office/trilium/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoPatchelfHook, atomEnv, makeWrapper, makeDesktopItem, gtk3, wrapGAppsHook }:
+{ stdenv, fetchurl, autoPatchelfHook, atomEnv, makeWrapper, makeDesktopItem, gtk3, wrapGAppsHook, zlib, libxkbfile }:
 
 let
   description = "Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases.";
@@ -11,12 +11,21 @@ let
     categories = "Office";
   };
 
+  meta = with stdenv.lib; {
+    inherit description;
+    homepage = https://github.com/zadam/trilium;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ emmanuelrosa dtzWill kampka ];
+  };
+
   version = "0.37.8";
 in {
   
   trilium-desktop = stdenv.mkDerivation rec {
     pname = "trilium-desktop";
     inherit version;
+    inherit meta;
 
     src = fetchurl {
       url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-${version}.tar.xz";
@@ -58,13 +67,43 @@ in {
     '';
   
     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 ];
+  };
+
+
+  trilium-server = stdenv.mkDerivation rec {
+    pname = "trilium-server";
+    inherit version;
+    inherit meta;
+
+    src = fetchurl {
+      url = "https://github.com/zadam/trilium/releases/download/v${version}/trilium-linux-x64-server-${version}.tar.xz";
+      sha256 = "04xhmc60fwvv8ip8mj112z7a9x5ahp51f1hvi20sffs0685mfaj3";
     };
+
+    nativeBuildInputs = [
+      autoPatchelfHook
+    ];
+
+    buildInputs = [
+      stdenv.cc.cc.lib
+      zlib
+      libxkbfile
+    ];
+
+    installPhase = ''
+      mkdir -p $out/bin
+      mkdir -p $out/share/trilium-server
+
+      cp -r ./* $out/share/trilium-server
+    '';
+
+    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
+    '';
   };
 }