Last active
October 30, 2023 06:10
-
-
Save pokon548/00142824b683d3825362fcbf62cb83a2 to your computer and use it in GitHub Desktop.
Fixup! siyuan-note
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, stdenv, fetchurl, appimageTools, makeWrapper, electron_27, autoPatchelfHook }: | |
stdenv.mkDerivation rec { | |
pname = "siyuan-note"; | |
version = "2.10.12"; | |
src = fetchurl { | |
url = "https://github.com/siyuan-note/siyuan/releases/download/v${version}/siyuan-${version}-linux.AppImage"; | |
hash = "sha256-G5lofIIkmm0DJLGc6MqBuwckCkdPA8FLs0qFH9bEYeU="; | |
}; | |
appimageContents = appimageTools.extractType2 { | |
name = "${pname}-${version}"; | |
inherit src; | |
}; | |
dontUnpack = true; | |
dontConfigure = true; | |
dontBuild = true; | |
nativeBuildInputs = [ makeWrapper autoPatchelfHook ]; | |
installPhase = '' | |
runHook preInstall | |
mkdir -p $out/bin $out/share/${pname} $out/share/applications | |
cp -a ${appimageContents}/{locales,resources} $out/share/${pname} | |
cp -a ${appimageContents}/siyuan.desktop $out/share/applications/${pname}.desktop | |
substituteInPlace $out/share/applications/${pname}.desktop \ | |
--replace 'Exec=AppRun' 'Exec=${pname}' | |
runHook postInstall | |
''; | |
postFixup = '' | |
autoPatchelf $out/share/siyuan-note/resources/kernel | |
makeWrapper ${electron_27}/bin/electron $out/bin/${pname} \ | |
--add-flags "$out/share/siyuan-note/resources/app \"\$@\"" \ | |
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" | |
''; | |
meta = with lib; { | |
homepage = "https://b3log.org/siyuan"; | |
description = "A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang."; | |
platforms = [ "x86_64-linux" ]; | |
license = licenses.agpl3Only; | |
maintainers = with maintainers; [ abd-liac ]; | |
}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment