logseq on arm64, latest signal on arm, waydroid, radicale, vscode

This commit is contained in:
steveej 2024-01-25 00:32:37 +01:00
parent 4def9ef949
commit 8c32db3406
12 changed files with 196 additions and 182 deletions

View file

@ -1,11 +1,4 @@
{ lib
, pname ? "logseq"
, version ? "0.10.5"
, src ? fetchurl {
url = "https://github.com/logseq/logseq/releases/download/${ version}/logseq-linux-x64-${ version}.AppImage";
hash = "sha256-F3YbqgvL04P0nXaIVkJlCq/z8hUE0M0UutkBs2omuBE=";
name = "${ pname}-${ version}.AppImage";
}
, stdenv
, fetchurl
, appimageTools
@ -14,67 +7,77 @@
, electron_27
, git
, nix-update-script
, overrideSrc ? null
}:
stdenv.mkDerivation
(finalAttrs:
let
inherit (finalAttrs) pname version src appimageContents;
stdenv.mkDerivation (finalAttrs:
let
inherit (finalAttrs) pname version src appimageContents;
in
{
inherit version pname src;
in
{
pname = "logseq";
version = "0.10.5";
appimageContents = appimageTools.extract {
inherit pname src version;
};
src = if overrideSrc != null then overrideSrc else
(fetchurl {
url = "https://github.com/logseq/logseq/releases/download/${version}/logseq-linux-x64-${version}.AppImage";
hash = "sha256-F3YbqgvL04P0nXaIVkJlCq/z8hUE0M0UutkBs2omuBE=";
name = "${pname}-${version}.AppImage";
});
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
appimageContents = appimageTools.extract {
inherit pname src version;
};
nativeBuildInputs = [ makeWrapper ];
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
nativeBuildInputs = [ makeWrapper ];
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
installPhase = ''
runHook preInstall
# remove the `git` in `dugite` because we want the `git` in `nixpkgs`
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
# remove the `git` in `dugite` because we want the `git` in `nixpkgs`
if test -e $out/share/${pname}/resources/app/node_modules/dugite/git; then
chmod +w -R $out/share/${pname}/resources/app/node_modules/dugite/git
chmod +w $out/share/${pname}/resources/app/node_modules/dugite
rm -rf $out/share/${pname}/resources/app/node_modules/dugite/git
chmod -w $out/share/${pname}/resources/app/node_modules/dugite
fi
mkdir -p $out/share/pixmaps
ln -s $out/share/${pname}/resources/app/icons/logseq.png $out/share/pixmaps/${pname}.png
mkdir -p $out/share/pixmaps
ln -s $out/share/${pname}/resources/app/icons/logseq.png $out/share/pixmaps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace Exec=Logseq Exec=${pname} \
--replace Icon=Logseq Icon=${pname}
substituteInPlace $out/share/applications/${pname}.desktop \
--replace Exec=Logseq Exec=${pname} \
--replace Icon=Logseq Icon=${pname}
runHook postInstall
'';
runHook postInstall
'';
postFixup = ''
# set the env "LOCAL_GIT_DIRECTORY" for dugite so that we can use the git in nixpkgs
makeWrapper ${electron_27}/bin/electron $out/bin/${pname} \
--set "LOCAL_GIT_DIRECTORY" ${git} \
--add-flags $out/share/${pname}/resources/app \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}"
'';
postFixup = ''
# set the env "LOCAL_GIT_DIRECTORY" for dugite so that we can use the git in nixpkgs
makeWrapper ${electron_27}/bin/electron $out/bin/${pname} \
--set "LOCAL_GIT_DIRECTORY" ${git} \
--add-flags $out/share/${pname}/resources/app \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}"
'';
passthru.updateScript = nix-update-script { };
passthru.updateScript = nix-update-script { };
meta = {
description = "A local-first, non-linear, outliner notebook for organizing and sharing your personal knowledge base";
homepage = "https://github.com/logseq/logseq";
changelog = "https://github.com/logseq/logseq/releases/tag/${version}";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
})
meta = {
description = "A local-first, non-linear, outliner notebook for organizing and sharing your personal knowledge base";
homepage = "https://github.com/logseq/logseq";
changelog = "https://github.com/logseq/logseq/releases/tag/${version}";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ ];
platforms = [ "x86_64-linux" "aarch64-linux" ];
};
})