{ stdenv, fetchFromGitHub, nixosTests, rustPlatform, lib, }: rustPlatform.buildRustPackage rec { pname = "nix-ld"; version = "2.0.0"; src = fetchFromGitHub { owner = "mic92"; repo = "nix-ld"; rev = version; hash = "sha256-rmSXQ4MYQe/OFDBRlqqw5kyp9b/aeEg0Fg9c167xofg="; }; cargoHash = "sha256-BVulfs4zm3Iruq00H49QcxR3V+iZvePtLBTytdXfLP4="; hardeningDisable = [ "stackprotector" ]; NIX_SYSTEM = stdenv.system; RUSTC_BOOTSTRAP = "1"; preCheck = '' export NIX_LD=${stdenv.cc.bintools.dynamicLinker} ''; postInstall = '' mkdir -p $out/libexec ln -s $out/bin/nix-ld $out/libexec/nix-ld mkdir -p $out/nix-support ldpath=/${stdenv.hostPlatform.libDir}/$(basename ${stdenv.cc.bintools.dynamicLinker}) echo "$ldpath" > $out/nix-support/ldpath mkdir -p $out/lib/tmpfiles.d/ cat > $out/lib/tmpfiles.d/nix-ld.conf <