crate2nix: 0.10.0 -> 0.11.0

...and add shell completions for bash/zsh
This commit is contained in:
Peter Kolloch 2023-10-22 18:57:07 +02:00 committed by Adam Joseph
parent 4fc0e33698
commit 7b9fa5f6c3

View File

@ -10,18 +10,18 @@
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "crate2nix"; pname = "crate2nix";
version = "0.10.0"; version = "0.11.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "kolloch"; owner = "nix-community";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "sha256-JaF9/H3m4Wrc5MtXcONkOAgKVkswLVw0yZe0dBr2e4Y="; sha256 = "sha256-nyX1lfaA0eBSB/BaxPzCsyD8p/hxCwNIvr4Ru3i/YX0=";
}; };
sourceRoot = "${src.name}/crate2nix"; sourceRoot = "${src.name}/crate2nix";
cargoSha256 = "sha256-PD7R1vcb3FKd4hfpViKyvfCExJ5H1Xo2HPYden5zpxQ="; cargoSha256 = "sha256-3+emOr3hh+DDkboJbYyJFZgkzmcdA9jdronz7wM4x28=";
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
@ -32,6 +32,13 @@ rustPlatform.buildRustPackage rec {
postFixup = '' postFixup = ''
wrapProgram $out/bin/crate2nix \ wrapProgram $out/bin/crate2nix \
--suffix PATH ":" ${lib.makeBinPath [ cargo nix nix-prefetch-git ]} --suffix PATH ":" ${lib.makeBinPath [ cargo nix 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
''; '';
meta = with lib; { meta = with lib; {
@ -40,9 +47,10 @@ rustPlatform.buildRustPackage rec {
Crate2nix generates Nix files from Cargo.toml/lock files Crate2nix generates Nix files from Cargo.toml/lock files
so that you can build every crate individually in a Nix sandbox. so that you can build every crate individually in a Nix sandbox.
''; '';
homepage = "https://github.com/kolloch/crate2nix"; homepage = "https://github.com/nix-community/crate2nix";
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ kolloch cole-h ]; maintainers = with maintainers; [ kolloch cole-h ];
platforms = platforms.all; platforms = platforms.all;
}; };
} }