chore(3p/overlays/tvl): switch to nixpkgs crate2nix

Since a recent nixpkgs bump bringing a version of cargo with
https://github.com/rust-lang/cargo/pull/12914,
crate2nix creates a crate-hashes.json with all crate hashes from
Cargo.lock (and downloads a lot of stuff while producing it).

https://github.com/nix-community/crate2nix/pull/341 prevents this from
happening, but our hardcoded crate2nix pin prevented us from getting the
fix included in 0.14.0, which did land in nixpkgs.

Replace the pin with a simply override, carrying our only leftover patch
on top of it, and link to that PR.

Change-Id: I9503898e15d61fa6a2b1589d141bec1b4ed3d616
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11581
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Florian Klink 2024-05-03 00:19:08 +03:00 committed by clbot
parent 7a7532d053
commit b8e82a42ed
3 changed files with 10 additions and 41 deletions

View file

@ -97,44 +97,12 @@ depot.nix.readTree.drvTargets {
];
});
crate2nix = super.rustPlatform.buildRustPackage rec {
pname = "crate2nix";
version = "0.13.0";
src = super.fetchFromGitHub {
owner = "nix-community";
repo = "crate2nix";
rev = "ceb06eb7e76afb9e01a5f069aae136f97df72730";
hash = "sha256-JTMe8GViCQt51WUiaaoIPmWtwEeeYrl6pBxo2DNuKig=";
};
patches = [
crate2nix = super.crate2nix.overrideAttrs (old: {
patches = old.patches or [ ] ++ [
# https://github.com/nix-community/crate2nix/pull/301
./patches/crate2nix-tests-debug.patch
./patches/crate2nix-run-tests-in-build-source.patch
];
sourceRoot = "${src.name}/crate2nix";
cargoHash = "sha256-dhlSXY1CJE+JJt+6Y7W1MVMz36nwr6ny543py1TcjyY=";
nativeBuildInputs = [ super.makeWrapper ];
# Tests use nix(1), which tries (and fails) to set up /nix/var inside the
# sandbox
doCheck = false;
postFixup = ''
wrapProgram $out/bin/crate2nix \
--suffix PATH ":" ${lib.makeBinPath (with self; [ cargo nix_latest nix-prefetch-git ])}
rm -rf $out/lib $out/bin/crate2nix.d
mkdir -p \
$out/share/bash-completion/completions \
$out/share/zsh/vendor-completions
$out/bin/crate2nix completions -s 'bash' -o $out/share/bash-completion/completions
$out/bin/crate2nix completions -s 'zsh' -o $out/share/zsh/vendor-completions
'';
};
});
evans = super.evans.overrideAttrs (old: {
patches = old.patches or [ ] ++ [