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.
This commit is contained in:
0xrsydn 2026-10-05 12:55:35 +07:00
commit 85bc2de6e7
6 changed files with 596 additions and 0 deletions

23
flake.nix Normal file
View file

@ -0,0 +1,23 @@
{
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";
});
});
};
}