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 08:27:24 +00:00
buildGoModule rec {
2021-10-12 08:27:24 +00:00
pname = "steampipe";
2024-04-09 23:19:55 +00:00
version = "0.22.2";
2021-10-12 08:27:24 +00:00
src = fetchFromGitHub {
owner = "turbot";
repo = "steampipe";
rev = "refs/tags/v${version}";
2024-04-09 23:19:55 +00:00
hash = "sha256-wHTuXSjHILlTgWSoaYKjEjQMWEih1EOJX8SIHdfVpU8=";
2021-10-12 08:27:24 +00:00
};
2024-04-09 23:19:55 +00:00
vendorHash = "sha256-sN4EbcxZ+XKL0MRqfKwBmv1+WtPj0uKw2HpSGcHI8AE=";
proxyVendor = true;
2021-10-12 08:27:24 +00:00
postPatch = ''
2022-07-16 02:47:09 +00: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 02:47:09 +00:00
'';
nativeBuildInputs = [
installShellFiles
makeWrapper
];
2021-10-13 20:20:33 +00:00
ldflags = [
"-s"
"-w"
];
2021-10-12 08:27:24 +00: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 16:02:05 +00:00
2021-10-13 20:20:33 +00:00
postInstall = ''
wrapProgram $out/bin/steampipe \
--set-default STEAMPIPE_UPDATE_CHECK false \
--set-default STEAMPIPE_TELEMETRY none
2021-10-13 20:20:33 +00: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 11:35:18 +00:00
description = "Dynamically query your cloud, code, logs & more with SQL";
homepage = "https://steampipe.io/";
license = lib.licenses.agpl3Only;
2024-03-26 09:05:42 +00:00
mainProgram = "steampipe";
maintainers = with lib.maintainers; [ hardselius anthonyroussel ];
2021-10-12 08:27:24 +00:00
};
}