2022-07-18 16:21:45 +00:00
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2021-10-17 09:34:42 +00:00
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
buildGoModule rec {
|
2021-10-17 09:34:42 +00:00
|
|
|
pname = "steampipe";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "0.18.6";
|
2021-10-17 09:34:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "turbot";
|
|
|
|
repo = "steampipe";
|
|
|
|
rev = "v${version}";
|
2023-02-22 10:55:15 +00:00
|
|
|
sha256 = "sha256-H/R+NXFaZ23vWN16/Ft5oP+Xvc97VY98cQth5+LtqnA=";
|
2021-10-17 09:34:42 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
vendorHash = "sha256-W30f7QYgm+QyLDJICpjMn7mtUIziTR1igThEbv+Aa7M=";
|
2022-02-10 20:34:41 +00:00
|
|
|
proxyVendor = true;
|
2021-10-17 09:34:42 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
patchPhase = ''
|
2022-10-06 18:32:54 +00:00
|
|
|
runHook prePatch
|
2022-08-12 12:06:08 +00:00
|
|
|
# Patch test that relies on looking up homedir in user struct to prefer ~
|
|
|
|
substituteInPlace pkg/steampipeconfig/shared_test.go \
|
2023-02-09 11:40:11 +00:00
|
|
|
--replace 'filehelpers "github.com/turbot/go-kit/files"' "" \
|
|
|
|
--replace 'filepaths.SteampipeDir, _ = filehelpers.Tildefy("~/.steampipe")' 'filepaths.SteampipeDir = "~/.steampipe"';
|
2022-10-06 18:32:54 +00:00
|
|
|
runHook postPatch
|
2022-08-12 12:06:08 +00:00
|
|
|
'';
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
2021-10-17 09:34:42 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://steampipe.io/";
|
|
|
|
description = "select * from cloud;";
|
|
|
|
license = licenses.agpl3;
|
|
|
|
maintainers = with maintainers; [ hardselius ];
|
2022-10-06 18:32:54 +00:00
|
|
|
changelog = "https://github.com/turbot/steampipe/blob/v${version}/CHANGELOG.md";
|
2021-10-17 09:34:42 +00:00
|
|
|
};
|
|
|
|
}
|