Change:
Project description but only for x86_64-linux. Would be great if it could be packaged also for aarch64-darwin. Builds exist in the loges project for multiple platforms already. Metadata homepage URL: source URL: license: AGPL-3.0 platforms: linux (already exist), aarch64-darwin
Logseq is quite good. I have support based on the current unstable version. It works, but a few issues are preventing me from submitting a PR: alert stating 'This file was downloaded on an unknown date.' prevents me from opening the app. I have to allow it in . I am not sure what causes this, maybe related: don't know how to remove the internal git, as the Linux version does.

Discussion:
, stdenv , fetchurl , appimageTools <ins> , unzip </ins> , makeWrapper # Notice: graphs will not sync without matching upstream's major electron version #         the specific electron version is set at top-level file to preserve override interface.

}: stdenv.mkDerivation (finalAttrs: let <del> inherit (finalAttrs) pname version src appimageContents; </del> <ins> inherit (finalAttrs) pname version src; inherit (stdenv.hostPlatform) system; selectSystem = attrs: attrs.${system} or (throw "Unsupported system: ${system}"); suffix = selectSystem { x86_64-linux = "linux-x64-${version}.AppImage"; x86_64-darwin = "darwin-x64-${version}.zip"; aarch64-darwin = "darwin-arm64-${version}.zip"; }; hash = selectSystem { x86_64-linux = "sha256-XROuY2RlKnGvK1VNvzauHuLJiveXVKrIYPppoz8fCmc="; x86_64-darwin = "sha256-0i9ozqBSeV/y8v+YEmQkbY0V6JHOv6tKub4O5Fdx2fQ="; aarch64-darwin = "sha256-Uvv96XWxpFj14wPH0DwPT+mlf3Z2dy1g/z8iBt5Te7Q="; }; </ins> in { pname = "logseq"; version = "0.10.9"; src = fetchurl { <del> url = "https://github.com/logseq/logseq/releases/download/${version}/logseq-linux-x64-${version}.AppImage"; hash = "sha256-XROuY2RlKnGvK1VNvzauHuLJiveXVKrIYPppoz8fCmc="; name = "${pname}-${version}.AppImage"; </del> <ins> inherit hash; url = "https://github.com/logseq/logseq/releases/download/${version}/logseq-${suffix}"; name = lib.optionalString stdenv.isLinux "${pname}-${version}.AppImage"; </ins> }; <del> appimageContents = appimageTools.extract { inherit pname src version; }; </del> <ins> nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ] ++ lib.optionals stdenv.isDarwin [ unzip ]; buildInputs = [ stdenv.cc.cc.lib ]; </ins> <del> dontUnpack = true; </del> <ins> dontUnpack = stdenv.isLinux; </ins> dontConfigure = true; dontBuild = true; <del> nativeBuildInputs = [ makeWrapper autoPatchelfHook ]; buildInputs = [ stdenv.cc.cc.lib ]; </del> installPhase = '' runHook preInstall <ins> '' + lib.optionalString stdenv.isLinux ( let appimageContents = appimageTools.extract { inherit pname src version; }; in '' </ins> 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=${pname} <ins> '') + lib.optionalString stdenv.isDarwin '' mkdir -p $out/{Applications/Logseq.app,bin} cp -R . $out/Applications/Logseq.app makeWrapper $out/Applications/Logseq.app/Contents/MacOS/Logseq $out/bin/${pname} '' + '' </ins> runHook postInstall ''; <del> postFixup = '' </del> <ins> postFixup = lib.optionalString stdenv.isLinux '' </ins> # set the env "LOCAL_GIT_DIRECTORY" for dugite so that we can use the git in nixpkgs makeWrapper ${electron}/bin/electron $out/bin/${pname}  --set "LOCAL_GIT_DIRECTORY" ${git} 

license = lib.licenses.agpl3Plus; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; maintainers = [ ]; <del> platforms = [ "x86_64-linux" ]; </del> <ins> platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin; </ins> mainProgram = "logseq"; }; })