evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / dr / driftctl / package.nix
blobb976308c4d8aa20ec4a25f7cbf6985753813fbb5
1 { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
3 buildGoModule rec {
4   pname = "driftctl";
5   version = "0.40.0";
7   src = fetchFromGitHub {
8     owner = "snyk";
9     repo = "driftctl";
10     rev = "v${version}";
11     sha256 = "sha256-IDKfW0NCEsgKXpHA7SwkHjMeoGAIYITlDVR/vI/b9hk=";
12   };
14   vendorHash = "sha256-JFvC9PReziktHSXbltGkGHjVR8hTM1hPJ0OqrZQXRQM=";
16   nativeBuildInputs = [ installShellFiles ];
18   ldflags = [
19     "-s"
20     "-w"
21     "-X github.com/snyk/driftctl/pkg/version.version=v${version}"
22     "-X github.com/snyk/driftctl/build.env=release"
23     "-X github.com/snyk/driftctl/build.enableUsageReporting=false"
24   ];
26   postInstall = ''
27     installShellCompletion --cmd driftctl \
28       --bash <($out/bin/driftctl completion bash) \
29       --fish <($out/bin/driftctl completion fish) \
30       --zsh <($out/bin/driftctl completion zsh)
31   '';
33   doInstallCheck = true;
34   installCheckPhase = ''
35     runHook preInstallCheck
37     $out/bin/driftctl --help
38     $out/bin/driftctl version | grep "v${version}"
39     # check there's no telemetry flag
40     $out/bin/driftctl --help | grep -vz "telemetry"
42     runHook postInstallCheck
43   '';
45   meta = with lib; {
46     homepage = "https://driftctl.com/";
47     changelog = "https://github.com/snyk/driftctl/releases/tag/v${version}";
48     description = "Detect, track and alert on infrastructure drift";
49     mainProgram = "driftctl";
50     longDescription = ''
51       driftctl is a free and open-source CLI that warns of infrastructure drift
52       and fills in the missing piece in your DevSecOps toolbox.
53     '';
54     license = licenses.asl20;
55     maintainers = with maintainers; [ kaction jk qjoly ];
56   };