2024-03-26 09:08:54 +00:00
|
|
|
{
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
|
|
lib,
|
2024-03-26 20:58:11 +00:00
|
|
|
makeWrapper,
|
2024-03-26 09:08:54 +00:00
|
|
|
nix-update-script,
|
|
|
|
steampipe,
|
|
|
|
testers,
|
|
|
|
}:
|
2021-10-12 08:27:24 +00:00
|
|
|
|
2022-06-29 21:13:54 +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";
|
2024-03-26 11:28:26 +00:00
|
|
|
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=";
|
2022-01-29 09:06:54 +00:00
|
|
|
proxyVendor = true;
|
2021-10-12 08:27:24 +00:00
|
|
|
|
2024-03-26 11:28:26 +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 \
|
2024-03-26 11:28:26 +00:00
|
|
|
--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
|
|
|
'';
|
|
|
|
|
2024-03-26 20:58:11 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
];
|
2021-10-13 20:20:33 +00:00
|
|
|
|
2024-03-26 11:28:26 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
];
|
2021-10-12 08:27:24 +00:00
|
|
|
|
2024-03-26 11:03:43 +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 = ''
|
2024-03-26 20:58:11 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2024-03-26 09:08:54 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
command = "${lib.getExe steampipe} --version";
|
|
|
|
package = steampipe;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
|
|
|
|
2024-03-26 11:28:26 +00:00
|
|
|
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";
|
2024-03-26 11:28:26 +00:00
|
|
|
homepage = "https://steampipe.io/";
|
|
|
|
license = lib.licenses.agpl3Only;
|
2024-03-26 09:05:42 +00:00
|
|
|
mainProgram = "steampipe";
|
2024-03-26 11:28:26 +00:00
|
|
|
maintainers = with lib.maintainers; [ hardselius anthonyroussel ];
|
2021-10-12 08:27:24 +00:00
|
|
|
};
|
|
|
|
}
|