From 3af28453019a98b26f5c08ed49a6df633b36addb Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 3 Sep 2026 05:00:42 +0200 Subject: Add support for AArch64 Linux Signed-off-by: Mel --- flake.nix | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index b13d1e9..3812ff2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,12 +2,12 @@ description = "a dumb minecraft in c++ and opengl."; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.11"; + nixpkgs.url = "nixpkgs/nixos-25.11"; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs }: let - allSystems = [ "x86_64-linux" "x86_64-darwin" ]; + allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; pkgsForSystem = system: nixpkgs.legacyPackages.${system}; @@ -15,24 +15,18 @@ (system: f { inherit system; pkgs = pkgsForSystem system; }); in { - packages = forAllSystems ({ system, pkgs }: { + packages = forAllSystems ({ system, pkgs }: { default = pkgs.callPackage ./. { - inherit (pkgs.darwin.apple_sdk.frameworks) - Cocoa OpenGL; - glfw = self.packages.${system}.glfw-static; glew = self.packages.${system}.glew-static; }; - # NOTE: GLFW depends on OpenSSL and coreutils, which are very - # large dependencies and have to be rebuilt from source to be able - # to be linked statically. Maybe there is a way to avoid this? - glfw-static = (pkgs.glfw.overrideAttrs (oldAttrs: { + glfw-static = pkgs.glfw.overrideAttrs (oldAttrs: { pname = "glfw-static"; cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DBUILD_SHARED_LIBS=OFF" ]; - })).override { waylandSupport = pkgs.stdenv.isLinux; }; + }); glew-static = pkgs.glew.overrideAttrs { pname = "glew-static"; @@ -40,20 +34,16 @@ }; }); - devShells = forAllSystems ({ system, pkgs }: + devShells = forAllSystems ({ system, pkgs }: let inherit (pkgs) lib stdenv; - - darwinFrameworks = pkgs.darwin.apple_sdk.frameworks; in - { + { default = pkgs.mkShell { buildInputs = (with pkgs; [ pkg-config ninja cmake meson lldb ]) ++ (with self.packages.${system}; [ glfw-static glew-static - ]) ++ lib.optionals stdenv.isDarwin (with darwinFrameworks; [ - Cocoa OpenGL ]) ++ lib.optionals stdenv.isLinux (with pkgs; [ wayland wayland-protocols libffi ]); -- cgit v1.3.1