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