summary refs log tree commit diff
path: root/pkgs/applications/misc/logseq
diff options
context:
space:
mode:
authorWeihua Lu <luwh364@gmail.com>2021-03-21 00:57:39 +0800
committertomberek <tomberek@users.noreply.github.com>2021-03-20 19:28:50 -0400
commitbf4a3c208e54c909e2e86497854a3be0304abb89 (patch)
tree032409e2fedb79075166b25f3917f92a05c29840 /pkgs/applications/misc/logseq
parent8efca926314ac3634fd306a1fd06e2d07fa270ba (diff)
downloadnixpkgs-bf4a3c208e54c909e2e86497854a3be0304abb89.tar
nixpkgs-bf4a3c208e54c909e2e86497854a3be0304abb89.tar.gz
nixpkgs-bf4a3c208e54c909e2e86497854a3be0304abb89.tar.bz2
nixpkgs-bf4a3c208e54c909e2e86497854a3be0304abb89.tar.lz
nixpkgs-bf4a3c208e54c909e2e86497854a3be0304abb89.tar.xz
nixpkgs-bf4a3c208e54c909e2e86497854a3be0304abb89.tar.zst
nixpkgs-bf4a3c208e54c909e2e86497854a3be0304abb89.zip
logseq: init at 0.0.13
Diffstat (limited to 'pkgs/applications/misc/logseq')
-rw-r--r--pkgs/applications/misc/logseq/default.nix52
-rwxr-xr-xpkgs/applications/misc/logseq/update.sh5
2 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/applications/misc/logseq/default.nix b/pkgs/applications/misc/logseq/default.nix
new file mode 100644
index 00000000000..6595cb3a913
--- /dev/null
+++ b/pkgs/applications/misc/logseq/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron }:
+
+stdenv.mkDerivation rec {
+  pname = "logseq";
+  version = "0.0.13";
+
+  src = fetchurl {
+    url = "https://github.com/logseq/logseq/releases/download/${version}/logseq-linux-x64-${version}.AppImage";
+    sha256 = "0a7c33f7d5ylcy6lqkpxp78wwyi4n5q4jdy7b8nx7p34sn2jnpf7";
+    name = "${pname}-${version}.AppImage";
+  };
+
+  appimageContents = appimageTools.extract {
+    name = "${pname}-${version}";
+    inherit src;
+  };
+
+  dontUnpack = true;
+  dontConfigure = true;
+  dontBuild = true;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/share/${pname} $out/share/applications
+    cp -a ${appimageContents}/{locales,resources} $out/share/${pname}
+    cp -a ${appimageContents}/Logseq.desktop $out/share/applications/${pname}.desktop
+
+    substituteInPlace $out/share/applications/${pname}.desktop \
+      --replace Exec=Logseq Exec=${pname} \
+      --replace Icon=Logseq Icon=$out/share/${pname}/resources/app/icons/logseq.png
+
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    makeWrapper ${electron}/bin/electron $out/bin/${pname} \
+      --add-flags $out/share/${pname}/resources/app
+  '';
+
+  passthru.updateScript = ./update.sh;
+
+  meta = with lib; {
+    description = "A local-first, non-linear, outliner notebook for organizing and sharing your personal knowledge base";
+    homepage = "https://github.com/logseq/logseq";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ weihua ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/applications/misc/logseq/update.sh b/pkgs/applications/misc/logseq/update.sh
new file mode 100755
index 00000000000..9f83eefad19
--- /dev/null
+++ b/pkgs/applications/misc/logseq/update.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl jq common-updater-scripts
+
+version="$(curl -sL "https://api.github.com/repos/logseq/logseq/releases" | jq '.[0].tag_name' --raw-output)"
+update-source-version logseq "$version"