aarch64-darwin compatible nix

This commit is contained in:
temidaradev 2026-06-26 18:49:38 +03:00
commit bff031b35b
Signed by: temidaradev
GPG key ID: CF0CCF7E9AD5BD9D
3 changed files with 28 additions and 18 deletions

View file

@ -5,7 +5,7 @@
self, self,
nixpkgs, nixpkgs,
}: let }: let
systems = ["x86_64-linux" "aarch64-linux"]; systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"];
forEachSystem = nixpkgs.lib.genAttrs systems; forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages; pkgsForEach = nixpkgs.legacyPackages;
in { in {

View file

@ -1,5 +1,6 @@
{ {
lib, lib,
stdenv,
rustPlatform, rustPlatform,
pkg-config, pkg-config,
makeBinaryWrapper, makeBinaryWrapper,
@ -45,13 +46,16 @@ in
installShellFiles # installManPage installShellFiles # installManPage
]; ];
buildInputs = [ buildInputs =
wayland [
libxkbcommon freetype
freetype fontconfig
fontconfig harfbuzz
harfbuzz ]
]; ++ lib.optionals stdenv.hostPlatform.isLinux [
wayland
libxkbcommon
];
# Install the terminfo entry, and make the Wayland/xkb libraries (loaded via # Install the terminfo entry, and make the Wayland/xkb libraries (loaded via
# dlopen, so not captured by rpath) discoverable at runtime. # dlopen, so not captured by rpath) discoverable at runtime.
@ -63,7 +67,8 @@ in
scdoc < doc/beer.1.scd > beer.1 scdoc < doc/beer.1.scd > beer.1
scdoc < doc/beer.toml.5.scd > beer.toml.5 scdoc < doc/beer.toml.5.scd > beer.toml.5
installManPage beer.1 beer.toml.5 installManPage beer.1 beer.toml.5
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram "$out/bin/beer" \ wrapProgram "$out/bin/beer" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [wayland libxkbcommon]} --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [wayland libxkbcommon]}
''; '';

View file

@ -1,4 +1,6 @@
{ {
lib,
stdenv,
mkShell, mkShell,
rustc, rustc,
cargo, cargo,
@ -35,15 +37,18 @@ mkShell {
scdoc # generate man pages from doc/*.scd scdoc # generate man pages from doc/*.scd
]; ];
buildInputs = [ buildInputs =
wayland [
wayland-protocols freetype
wayland-scanner fontconfig
libxkbcommon harfbuzz
freetype ]
fontconfig ++ lib.optionals stdenv.hostPlatform.isLinux [
harfbuzz wayland
]; wayland-protocols
wayland-scanner
libxkbcommon
];
# Compile the beer terminfo into a project-local database and put it ahead of # Compile the beer terminfo into a project-local database and put it ahead of
# the system one, so TERM=beer resolves inside the shell (and for the shell # the system one, so TERM=beer resolves inside the shell (and for the shell