diff --git a/flake.nix b/flake.nix index 3648b82..b38688d 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,7 @@ self, nixpkgs, }: let - systems = ["x86_64-linux" "aarch64-linux"]; + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"]; forEachSystem = nixpkgs.lib.genAttrs systems; pkgsForEach = nixpkgs.legacyPackages; in { diff --git a/nix/package.nix b/nix/package.nix index 5c19725..d55c52b 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -1,5 +1,6 @@ { lib, + stdenv, rustPlatform, pkg-config, makeBinaryWrapper, @@ -45,13 +46,16 @@ in installShellFiles # installManPage ]; - buildInputs = [ - wayland - libxkbcommon - freetype - fontconfig - harfbuzz - ]; + buildInputs = + [ + freetype + fontconfig + harfbuzz + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + libxkbcommon + ]; # Install the terminfo entry, and make the Wayland/xkb libraries (loaded via # dlopen, so not captured by rpath) discoverable at runtime. @@ -63,7 +67,8 @@ in scdoc < doc/beer.1.scd > beer.1 scdoc < doc/beer.toml.5.scd > beer.toml.5 installManPage beer.1 beer.toml.5 - + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' wrapProgram "$out/bin/beer" \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [wayland libxkbcommon]} ''; diff --git a/nix/shell.nix b/nix/shell.nix index 424960b..ab735d1 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -1,4 +1,6 @@ { + lib, + stdenv, mkShell, rustc, cargo, @@ -35,15 +37,18 @@ mkShell { scdoc # generate man pages from doc/*.scd ]; - buildInputs = [ - wayland - wayland-protocols - wayland-scanner - libxkbcommon - freetype - fontconfig - harfbuzz - ]; + buildInputs = + [ + freetype + fontconfig + harfbuzz + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + wayland-protocols + wayland-scanner + libxkbcommon + ]; # 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