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-03-30 22:05:00 +00:00
|
|
|
version = "0.19.3";
|
2021-10-17 09:34:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "turbot";
|
|
|
|
repo = "steampipe";
|
|
|
|
rev = "v${version}";
|
2023-03-30 22:05:00 +00:00
|
|
|
sha256 = "sha256-RbtIDgTVS/vtYQpbTQ7Yl7oBtC8c6D9Pns9SdEjUsmI=";
|
2021-10-17 09:34:42 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
vendorHash = "sha256-XrEdaNLG46BwMEF/vhAk9+A6vH4mpbtH7vWXd01Y7ME=";
|
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
|
|
|
};
|
|
|
|
}
|