diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..fd1211c --- /dev/null +++ b/flake.lock @@ -0,0 +1,62 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1747179050, + "narHash": "sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "adaa24fbf46737f3f1b5497bf64bae750f82942e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1744536153, + "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1747190175, + "narHash": "sha256-s33mQ2s5L/2nyllhRTywgECNZyCqyF4MJeM3vG/GaRo=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "58160be7abad81f6f8cb53120d5b88c16e01c06d", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..384ed7a --- /dev/null +++ b/flake.nix @@ -0,0 +1,41 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + rust-overlay.url = "github:oxalica/rust-overlay"; + }; + + outputs = { + self, + nixpkgs, + rust-overlay, + }: let + system = "aarch64-darwin"; + pkgs = import nixpkgs { + inherit system; + overlays = [rust-overlay.overlays.default]; + }; + #toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + manifest = (pkgs.lib.importTOML ./Cargo.toml).package; + in { + devShells.${system}.default = pkgs.mkShell { + packages = [ + #toolchain + ]; + + nativeBuildInputs = [ + #pkgs.clang_19 + #pkgs.cmake + ]; + + CXXFLAGS_aarch64_apple_darwin = "--target=aarch64-apple-darwin"; + + }; + + packages.${system}.default = pkgs.rustPlatform.buildRustPackage rec { + pname = manifest.name; + inherit (manifest) version; + cargoLock.lockFile = ./Cargo.lock; + src = pkgs.lib.cleanSource ./.; + }; + }; +}