evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / ty / typeshare / package.nix
blob600c53e69d294f2db5a5e0da8ec9d6b9e9a8aace
1 { lib
2 , rustPlatform
3 , fetchFromGitHub
4 , installShellFiles
5 , stdenv
6 }:
8 rustPlatform.buildRustPackage rec {
9   pname = "typeshare";
10   version = "1.11.0";
12   src = fetchFromGitHub {
13     owner = "1password";
14     repo = "typeshare";
15     rev = "v${version}";
16     hash = "sha256-hzlrhawHQOM12pYAHqmkk+PPI/3tJx8rFFQ9+znv9c8=";
17   };
19   cargoHash = "sha256-yHtKgQZlKJ/vmecjzMHkmA/0sbiNJdP0zoUSIowWttQ=";
21   nativeBuildInputs = [ installShellFiles ];
23   buildFeatures = [ "go" ];
25   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
26     installShellCompletion --cmd typeshare \
27       --bash <($out/bin/typeshare completions bash) \
28       --fish <($out/bin/typeshare completions fish) \
29       --zsh <($out/bin/typeshare completions zsh)
30   '';
32   meta = with lib; {
33     description = "Command Line Tool for generating language files with typeshare";
34     mainProgram = "typeshare";
35     homepage = "https://github.com/1password/typeshare";
36     changelog = "https://github.com/1password/typeshare/blob/v${version}/CHANGELOG.md";
37     license = with licenses; [ asl20 /* or */ mit ];
38     maintainers = with maintainers; [ figsoda ];
39   };