diff --git a/pkgs/development/tools/rust/typeshare/default.nix b/pkgs/development/tools/rust/typeshare/default.nix index 6e96bf72bbad..afcdedd9bf88 100644 --- a/pkgs/development/tools/rust/typeshare/default.nix +++ b/pkgs/development/tools/rust/typeshare/default.nix @@ -1,22 +1,37 @@ -{ lib, rustPlatform, fetchCrate }: +{ lib +, rustPlatform +, fetchFromGitHub +, installShellFiles +}: rustPlatform.buildRustPackage rec { pname = "typeshare"; - version = "1.0.1"; + version = "1.1.0"; - src = fetchCrate { - inherit version; - pname = "typeshare-cli"; - sha256 = "sha256-SbTI7170Oc1e09dv4TvUwByG3qkyAL5YXZ96NzI0FSI="; + src = fetchFromGitHub { + owner = "1password"; + repo = "typeshare"; + rev = "v${version}"; + hash = "sha256-FQ9KL8X7zz3ew+H1lhh4bkZ01Te1TD+QXAMxS8dXAaI="; }; - cargoSha256 = "sha256-5EhXw2WcRJqCbdMvOtich9EYQqi0uwCH1a1XXIo8aAo="; + cargoHash = "sha256-t6tGNHmPasmTRto2hobvJywrF/8tO79zkfWwa6lCPK8="; + + nativeBuildInputs = [ installShellFiles ]; buildFeatures = [ "go" ]; + postInstall = '' + installShellCompletion --cmd typeshare \ + --bash <($out/bin/typeshare completions bash) \ + --fish <($out/bin/typeshare completions fish) \ + --zsh <($out/bin/typeshare completions zsh) + ''; + meta = with lib; { description = "Command Line Tool for generating language files with typeshare"; homepage = "https://github.com/1password/typeshare"; + changelog = "https://github.com/1password/typeshare/blob/v${version}/CHANGELOG.md"; license = with licenses; [ asl20 /* or */ mit ]; maintainers = with maintainers; [ figsoda ]; };