gameboy-rust/flake.nix
0xrsydn 85bc2de6e7 chore(dev): bootstrap Rust and Nix environments for Darwin
Configure direnv, native Darwin compiler flags, and pinned desktop dependencies. Exclude build outputs, local environments, ROMs, and saves.

Start an ordered import of existing work. Feature chunks share dependencies; validate the integrated stack, not each intermediate import.
2026-10-05 12:58:37 +07:00

23 lines
926 B
Nix

{
description = "A minimal GBA emulator written in Rust";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { nixpkgs, ... }:
let
systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
in {
devShells = nixpkgs.lib.genAttrs systems (system:
let pkgs = import nixpkgs { inherit system; };
in {
default = pkgs.mkShell ({
packages = with pkgs; [ rustc cargo rustfmt clippy ];
} // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
# minifb 0.28 hard-codes macOS 10.10 before user CFLAGS.
# Match the Nix SDK's deployment target so Metal APIs are available.
# Its Objective-C files also share a tentative g_metal_device definition.
CFLAGS = "-mmacosx-version-min=${pkgs.stdenv.hostPlatform.darwinMinVersion} -fcommon";
});
});
};
}