{ inputs = { fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; nixpkgs.url = "nixpkgs/nixos-unstable"; }; outputs = { nixpkgs, fenix, ... }: let systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; foreachSystem = nixpkgs.lib.genAttrs systems; in rec { packages = foreachSystem (system: let pkgs = import nixpkgs { inherit system; }; rustPlatform = pkgs.makeRustPlatform { cargo = fenix.packages."${pkgs.stdenv.system}".complete.toolchain; rustc = fenix.packages."${pkgs.stdenv.system}".complete.toolchain; }; buildTools = with pkgs; [ pkg-config ]; libraries = with pkgs; [ sqlite ] ++ (nixpkgs.lib.optional pkgs.stdenv.isDarwin darwin.apple_sdk.frameworks.Security); in rec { hello = rustPlatform.buildRustPackage rec { pname = "hello"; version = "1.0.0"; nativeBuildInputs = buildTools; buildInputs = libraries; src = ./.; cargoLock = { lockFile = ./Cargo.lock; }; meta = with nixpkgs.lib; { description = "rust project scaffold"; homepage = "https://git.jeffthecoder.xyz/public/os-flakes"; license = licenses.unlicense; maintainers = [ ]; }; }; default = hello; }); devShells = foreachSystem (system: let pkgs = import nixpkgs { inherit system; }; developmentTools = with pkgs; [ # bpf-linker # cargo-espflash # cargo-generate # cargo-make # cargo-mobile2 # cargo-tauri # cargo-watch # TODO: cargo-xcode # TODO: create-tauri-app # cargo-espflash # TODO: kopium # TODO: ldproxy # TODO: paperclip sea-orm-cli # perseus-cli # trunk # wasm-bindgen-cli ] ++ (with fenix.packages."${system}".complete; [ rust-analyzer rust-src ]); in with pkgs; rec { default = packages."${system}".default.overrideAttrs (prevAttrs: { nativeBuildInputs = prevAttrs.nativeBuildInputs ++ developmentTools; RUST_SRC_PATH = stdenv.mkDerivation { inherit (rustc) src; inherit (rustc.src) name; phases = ["unpackPhase" "installPhase"]; installPhase = ''cp -r library $out''; }; }); }); }; }