{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; # Rust rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; }; }; outputs = { self, nixpkgs, rust-overlay, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let overlays = [ (import rust-overlay) ]; pkgs = import nixpkgs { inherit system overlays; }; lib = pkgs.lib; toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; stdenv = if pkgs.stdenv.isLinux then pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv else pkgs.stdenv; in { devShells.default = pkgs.mkShell.override { inherit stdenv; } { buildInputs = [ pkgs.rust-analyzer-unwrapped toolchain ]; RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library"; }; packages.default = pkgs.rustPlatform.buildRustPackage.override { inherit stdenv; } { pname = "awsbck"; inherit ((lib.importTOML ./Cargo.toml).package) version; src = lib.cleanSource ./.; cargoLock = { lockFile = ./Cargo.lock; allowBuiltinFetchGit = true; }; buildInputs = lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security ]; doCheck = false; }; }); }