nixpkgs/pkgs/by-name/po/powerpipe/package.nix
2024-08-25 07:54:18 +00:00

71 lines
1.6 KiB
Nix

{
buildGoModule,
fetchFromGitHub,
installShellFiles,
lib,
makeWrapper,
nix-update-script,
powerpipe,
testers,
}:
buildGoModule rec {
pname = "powerpipe";
version = "0.4.3";
src = fetchFromGitHub {
owner = "turbot";
repo = "powerpipe";
rev = "refs/tags/v${version}";
hash = "sha256-WrjdxLlDvC+rq3bJ0U8pqSJvfqH9Y54BOoWUfb5pMho=";
};
vendorHash = "sha256-zBwk03aEjWs+CfbIZh0g7absKc5+SNLTVhrctuTpjMk=";
proxyVendor = true;
nativeBuildInputs = [
installShellFiles
makeWrapper
];
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
doCheck = true;
checkFlags =
let
skippedTests = [
# test fails in the original github.com/turbot/powerpipe project as well
"TestGetAsSnapshotPropertyMap/card"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
postInstall = ''
wrapProgram $out/bin/powerpipe \
--set-default POWERPIPE_UPDATE_CHECK false \
--set-default POWERPIPE_TELEMETRY none
'';
passthru = {
tests.version = testers.testVersion {
command = "${lib.getExe powerpipe} --version";
package = powerpipe;
version = "v${version}";
};
updateScript = nix-update-script { };
};
meta = {
changelog = "https://github.com/turbot/powerpipe/blob/v${version}/CHANGELOG.md";
description = "Dynamically query your cloud, code, logs & more with SQL";
homepage = "https://powerpipe.io/";
license = lib.licenses.agpl3Only;
mainProgram = "powerpipe";
maintainers = with lib.maintainers; [ weitzj ];
};
}