Skip to content

Instantly share code, notes, and snippets.

@charles-l
Created August 29, 2024 03:36
Show Gist options
  • Save charles-l/497dad09b63696526c265062c8b6fa1f to your computer and use it in GitHub Desktop.
Save charles-l/497dad09b63696526c265062c8b6fa1f to your computer and use it in GitHub Desktop.
Flake for Rust + Bevy development on M3 Mac
{
description = "Bevy flake";
inputs =
{
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # or whatever vers
};
outputs = { self, nixpkgs, ... }@inputs:
let
system = "aarch64-darwin"; # your version
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.${system}.default = pkgs.mkShell
{
packages = with pkgs; [ rustc cargo libiconv pkg-config ];
nativeBuildInputs = with pkgs; [
darwin.apple_sdk.frameworks.Foundation
darwin.apple_sdk.frameworks.CoreVideo
darwin.apple_sdk.frameworks.Carbon
darwin.apple_sdk.frameworks.AppKit
# list of frameworks in case you need another: https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/darwin/apple-sdk/frameworks.nix
];
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment