{ lib, rustPlatform, llvm, clang, wild, }: let pname = "microfetch"; toml = (lib.importTOML ../Cargo.toml).workspace.package; inherit (toml) version; inherit (llvm) stdenv; # wild + clang are only used on Linux tier-1 arches hasWild = stdenv.hostPlatform.isLinux && (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isAarch64); in rustPlatform.buildRustPackage.override {inherit stdenv;} (finalAttrs: { __structuredAttrs = true; inherit pname version; src = let fs = lib.fileset; s = ../.; in fs.toSource { root = s; fileset = fs.unions [ (s + /.cargo) (s + /crates) (s + /microfetch) (s + /Cargo.lock) (s + /Cargo.toml) ]; }; nativeBuildInputs = lib.optionals hasWild [wild clang]; env = lib.optionalAttrs hasWild { RUSTFLAGS = "-Cforce-unwind-tables=no -Clinker=${clang}/bin/clang -Clink-arg=--ld-path=${wild}/bin/wild"; }; cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock"; enableParallelBuilding = true; buildNoDefaultFeatures = true; doCheck = false; strictDeps = true; meta = { description = "Microscopic fetch script in Rust, for NixOS systems"; homepage = "https://github.com/NotAShelf/microfetch"; license = lib.licenses.gpl3Only; platforms = lib.platforms.linux; maintainers = [lib.maintainers.NotAShelf]; mainProgram = "microfetch"; }; })