Files
nixpkgs/pkgs/by-name/dr/driftctl/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

68 lines
1.7 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "driftctl";
version = "0.40.0";
src = fetchFromGitHub {
owner = "snyk";
repo = "driftctl";
rev = "v${version}";
sha256 = "sha256-IDKfW0NCEsgKXpHA7SwkHjMeoGAIYITlDVR/vI/b9hk=";
};
vendorHash = "sha256-JFvC9PReziktHSXbltGkGHjVR8hTM1hPJ0OqrZQXRQM=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X github.com/snyk/driftctl/pkg/version.version=v${version}"
"-X github.com/snyk/driftctl/build.env=release"
"-X github.com/snyk/driftctl/build.enableUsageReporting=false"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd driftctl \
--bash <($out/bin/driftctl completion bash) \
--fish <($out/bin/driftctl completion fish) \
--zsh <($out/bin/driftctl completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/driftctl --help
$out/bin/driftctl version | grep "v${version}"
# check there's no telemetry flag
$out/bin/driftctl --help | grep -vz "telemetry"
runHook postInstallCheck
'';
meta = {
homepage = "https://driftctl.com/";
changelog = "https://github.com/snyk/driftctl/releases/tag/v${version}";
description = "Detect, track and alert on infrastructure drift";
mainProgram = "driftctl";
longDescription = ''
driftctl is a free and open-source CLI that warns of infrastructure drift
and fills in the missing piece in your DevSecOps toolbox.
'';
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
kaction
jk
qjoly
];
};
}