2024-01-02 11:29:13 +00:00
|
|
|
{ lib, stdenv, 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";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.21.1";
|
2021-10-17 09:34:42 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "turbot";
|
|
|
|
repo = "steampipe";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-UTKonirf27C3q3tYznMfNtAQ3S7T1Vzlwz05jAoLfoI=";
|
2021-10-17 09:34:42 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
vendorHash = "sha256-zzXAAxN2PRqAx4LDJjVAoLm1HnhVdBe/Mzyuai8CEXg=";
|
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
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# panic: could not create backups directory: mkdir /var/empty/.steampipe: operation not permitted
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|