about summary refs log tree commit diff
path: root/pkgs/applications/office/appflowy
diff options
context:
space:
mode:
authorDarkOnion0 <Darkgenius1@protonmail.com>2022-01-03 14:54:07 +0100
committerDarkOnion0 <Darkgenius1@protonmail.com>2022-01-04 17:43:03 +0100
commit79e65cb57db2cb1366453626b03970bda2304a9b (patch)
treea0d4872acb30bf55503fbdb12494342dde99b7b2 /pkgs/applications/office/appflowy
parentcaa56925f9f467d3a1b21884643183f3a4aa8b0f (diff)
appflowy: init at 0.0.2
Diffstat (limited to 'pkgs/applications/office/appflowy')
-rw-r--r--pkgs/applications/office/appflowy/default.nix76
1 files changed, 76 insertions, 0 deletions
diff --git a/pkgs/applications/office/appflowy/default.nix b/pkgs/applications/office/appflowy/default.nix
new file mode 100644
index 0000000000000..05bb88bdfe748
--- /dev/null
+++ b/pkgs/applications/office/appflowy/default.nix
@@ -0,0 +1,76 @@
+{ stdenv,
+  lib,
+  fetchzip,
+  autoPatchelfHook,
+  makeWrapper,
+  copyDesktopItems,
+  makeDesktopItem,
+  gtk3,
+  openssl,
+  xdg-user-dirs
+}:
+
+stdenv.mkDerivation rec {
+  pname = "appflowy";
+  version = "0.0.2";
+
+  src = fetchzip {
+    url = "https://github.com/AppFlowy-IO/appflowy/releases/download/${version}/AppFlowy-linux-x86.tar.gz";
+    sha256 = "1fvv4mlgf0vqcq5zh0zl2xr44saz0sm47r8whcywwrmcm0l66iv6";
+  };
+
+  nativeBuildInputs = [
+      autoPatchelfHook
+      makeWrapper
+      copyDesktopItems
+  ];
+
+  buildInputs = [
+      gtk3
+      openssl
+  ];
+
+  dontBuild = true;
+  dontConfigure = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/opt/
+    mkdir -p $out/bin/
+
+    # Copy archive contents to the outpout directory
+    cp -r ./* $out/opt/
+
+    runHook postInstall
+  '';
+
+  preFixup = let
+    libPath = lib.makeLibraryPath [
+      xdg-user-dirs
+    ];
+  in ''
+    # Add missing libraries to appflowy using the ones it comes with
+    makeWrapper $out/opt/app_flowy $out/bin/appflowy \
+          --set LD_LIBRARY_PATH "$out/opt/lib/:${libPath}"
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = pname;
+      desktopName = "AppFlowy";
+      comment = meta.description;
+      exec = "appflowy";
+      categories = "Office;";
+    })
+  ];
+
+  meta = with lib; {
+    description = "An open-source alternative to Notion";
+    homepage = "https://www.appflowy.io/";
+    license = licenses.agpl3Only;
+    changelog = "https://github.com/AppFlowy-IO/appflowy/releases/tag/${version}";
+    maintainers = with maintainers; [ darkonion0 ];
+    platforms = [ "x86_64-linux" ];
+  };
+}