diff --git a/flake.nix b/flake.nix index 2927a54..5fe00ff 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Cargo project with cross-compilation support"; + description = "bRAC"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; @@ -8,59 +8,28 @@ }; outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }: - flake-utils.lib.eachSystem [ - "x86_64-linux" - "x86_64-darwin" - "x86_64-windows" - "i686-linux" - "i686-windows" - "aarch64-darwin" - ] (system: + flake-utils.lib.eachDefaultSystem (system: let overlays = [ (import rust-overlay) ]; pkgs = import nixpkgs { inherit system overlays; - crossSystem = (import ).systems.examples.gnu64 // { - rust.rustcTarget = { - "x86_64-linux" = "x86_64-unknown-linux-gnu"; - "x86_64-darwin" = "x86_64-apple-darwin"; - "x86_64-windows" = "x86_64-pc-windows-gnu"; - "i686-linux" = "i686-unknown-linux-gnu"; - "i686-windows" = "i686-pc-windows-gnu"; - "aarch64-darwin" = "aarch64-apple-darwin"; - }.${system}; # here invalid target format - }; }; - - exeSuffix = if pkgs.stdenv.hostPlatform.isWindows then ".exe" else ""; in { devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ rust-bin.stable.latest.default pkg-config - (if stdenv.isDarwin then darwin.libiconv else null) ]; }; packages.default = pkgs.rustPlatform.buildRustPackage { - pname = "my-cargo-project"; - version = "0.1.0"; + pname = "bRAC"; + version = "0.1.2+1.99.2"; src = pkgs.lib.cleanSource ./.; cargoLock = { lockFile = ./Cargo.lock; }; - - meta = with pkgs.lib; { - description = "My Rust project"; - license = licenses.mit; - maintainers = with maintainers; [ ]; - platforms = platforms.all; - }; - - postInstall = '' - mv $out/bin/bRAC $out/bin/bRAC-${system}${exeSuffix} - ''; }; }); } \ No newline at end of file