Add aarch64 typora

This commit is contained in:
Natsu Kagami 2023-02-27 18:31:50 +01:00
parent 9412c57a05
commit 583ed20387
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
3 changed files with 56 additions and 0 deletions

View file

@ -44,6 +44,8 @@ in
discord
typora
# Java & sbt
openjdk11
sbt

View file

@ -43,6 +43,10 @@ let
});
# Zotero does not have their own aarch64-linux build
zotero = final.callPackage ./packages/aarch64-linux/zotero.nix { };
# Typora for aarch64-linux only
typora = optionalOverride
(builtins.abort "no support for non-aarch64-linux")
(final.callPackage ./packages/aarch64-linux/typora.nix { });
};
overlay-asahi = inputs.nixos-m1.overlays.default;

View file

@ -0,0 +1,50 @@
{ pkgs, runCommand, zstd, lib, buildFHSUserEnv }:
let
typora-tar = builtins.fetchurl {
url = "https://download.typora.io/linux/Typora-linux-arm64.tar.gz";
sha256 = "sha256:1xp25rvr8hr8b4dwb55d9229bbnpq7kd2bxvz7l3dfhn39zpxxjg";
};
typora-src = runCommand "typora-src" { } ''
mkdir -p $out
tar xvf ${typora-tar} -C $out
'';
in
buildFHSUserEnv {
name = "typora";
targetPkgs = pkgs: with pkgs; [
glib
nss
nspr
at-spi2-atk
cups
dbus
gtk3
pango
cairo
mesa
expat
libdrm
libxkbcommon
alsa-lib
freefont_ttf
liberation_ttf
wayland
libglvnd
electron
] ++ (with pkgs.xorg; [
libX11
libXcomposite
libXdamage
libXext
libXfixes
libXrandr
libxcb
]);
extraBuildCommands = ''
# ldd ${typora-src}/bin/Typora-linux-arm64/Typora && false
'';
# runScript = "${typora-src}/bin/Typora-linux-arm64/Typora --enable-features=UseOzonePlatform --ozone-platform=wayland";
runScript = "electron ${typora-src}/bin/Typora-linux-arm64/resources/app.asar";
}