nixpkgs/pkgs/by-name/st/steampipe/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.3 KiB
Nix
Raw Normal View History

{
buildGoModule,
fetchFromGitHub,
installShellFiles,
lib,
makeWrapper,
nix-update-script,
steampipe,
testers,
}:
2021-10-12 10:27:24 +02:00
buildGoModule rec {
2021-10-12 10:27:24 +02:00
pname = "steampipe";
2024-04-10 01:19:55 +02:00
version = "0.22.2";
2021-10-12 10:27:24 +02:00
src = fetchFromGitHub {
owner = "turbot";
repo = "steampipe";
rev = "refs/tags/v${version}";
2024-04-10 01:19:55 +02:00
hash = "sha256-wHTuXSjHILlTgWSoaYKjEjQMWEih1EOJX8SIHdfVpU8=";
2021-10-12 10:27:24 +02:00
};
2024-04-10 01:19:55 +02:00
vendorHash = "sha256-sN4EbcxZ+XKL0MRqfKwBmv1+WtPj0uKw2HpSGcHI8AE=";
proxyVendor = true;
2021-10-12 10:27:24 +02:00
postPatch = ''
2022-07-16 04:47:09 +02:00
# Patch test that relies on looking up homedir in user struct to prefer ~
substituteInPlace pkg/steampipeconfig/shared_test.go \
--replace-fail 'filehelpers "github.com/turbot/go-kit/files"' "" \
--replace-fail 'filepaths.SteampipeDir, _ = filehelpers.Tildefy("~/.steampipe")' 'filepaths.SteampipeDir = "~/.steampipe"';
2022-07-16 04:47:09 +02:00
'';
nativeBuildInputs = [
installShellFiles
makeWrapper
];
2021-10-13 22:20:33 +02:00
ldflags = [
"-s"
"-w"
];
2021-10-12 10:27:24 +02:00
doCheck = true;
checkFlags =
let
skippedTests = [
# panic: could not create backups directory: mkdir /var/empty/.steampipe: operation not permitted
"TestTrimBackups"
# Skip tests that require network access
"TestIsPortBindable"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
2023-12-08 17:02:05 +01:00
2021-10-13 22:20:33 +02:00
postInstall = ''
wrapProgram $out/bin/steampipe \
--set-default STEAMPIPE_UPDATE_CHECK false \
--set-default STEAMPIPE_TELEMETRY none
2021-10-13 22:20:33 +02:00
INSTALL_DIR=$(mktemp -d)
installShellCompletion --cmd steampipe \
--bash <($out/bin/steampipe --install-dir $INSTALL_DIR completion bash) \
--fish <($out/bin/steampipe --install-dir $INSTALL_DIR completion fish) \
--zsh <($out/bin/steampipe --install-dir $INSTALL_DIR completion zsh)
'';
passthru = {
tests.version = testers.testVersion {
command = "${lib.getExe steampipe} --version";
package = steampipe;
version = "v${version}";
};
updateScript = nix-update-script { };
};
meta = {
changelog = "https://github.com/turbot/steampipe/blob/v${version}/CHANGELOG.md";
2024-03-26 12:35:18 +01:00
description = "Dynamically query your cloud, code, logs & more with SQL";
homepage = "https://steampipe.io/";
license = lib.licenses.agpl3Only;
2024-03-26 10:05:42 +01:00
mainProgram = "steampipe";
maintainers = with lib.maintainers; [ hardselius anthonyroussel ];
2021-10-12 10:27:24 +02:00
};
}