2023-12-08 17:02:05 +01:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2021-10-12 10:27:24 +02:00
|
|
|
|
2022-06-29 23:13:54 +02:00
|
|
|
buildGoModule rec {
|
2021-10-12 10:27:24 +02:00
|
|
|
pname = "steampipe";
|
2024-03-18 14:38:51 +01:00
|
|
|
version = "0.22.1";
|
2021-10-12 10:27:24 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "turbot";
|
|
|
|
repo = "steampipe";
|
|
|
|
rev = "v${version}";
|
2024-03-18 14:38:51 +01:00
|
|
|
hash = "sha256-Oz1T9koeXnmHc5oru1apUtmhhvKi/gAtg/Hb7HKkkP0=";
|
2021-10-12 10:27:24 +02:00
|
|
|
};
|
|
|
|
|
2024-03-26 09:52:53 +01:00
|
|
|
vendorHash = "sha256-U0BeGCRLjL56ZmVKcKqrrPTCXpShJzJq5/wnXDKax6g=";
|
2022-01-29 10:06:54 +01:00
|
|
|
proxyVendor = true;
|
2021-10-12 10:27:24 +02:00
|
|
|
|
2022-07-16 04:47:09 +02:00
|
|
|
patchPhase = ''
|
2022-10-01 11:54:00 +02:00
|
|
|
runHook prePatch
|
2022-07-16 04:47:09 +02:00
|
|
|
# Patch test that relies on looking up homedir in user struct to prefer ~
|
|
|
|
substituteInPlace pkg/steampipeconfig/shared_test.go \
|
2023-02-01 05:53:27 +01:00
|
|
|
--replace 'filehelpers "github.com/turbot/go-kit/files"' "" \
|
|
|
|
--replace 'filepaths.SteampipeDir, _ = filehelpers.Tildefy("~/.steampipe")' 'filepaths.SteampipeDir = "~/.steampipe"';
|
2022-10-01 11:54:00 +02:00
|
|
|
runHook postPatch
|
2022-07-16 04:47:09 +02:00
|
|
|
'';
|
|
|
|
|
2021-10-13 22:20:33 +02:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-07-16 04:47:09 +02:00
|
|
|
ldflags = [ "-s" "-w" ];
|
2021-10-12 10:27:24 +02:00
|
|
|
|
2023-12-08 17:02:05 +01:00
|
|
|
# panic: could not create backups directory: mkdir /var/empty/.steampipe: operation not permitted
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2021-10-13 22:20:33 +02: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)
|
|
|
|
'';
|
|
|
|
|
2021-10-12 10:27:24 +02:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://steampipe.io/";
|
|
|
|
description = "select * from cloud;";
|
2024-03-19 13:26:06 +01:00
|
|
|
license = licenses.agpl3Only;
|
2021-10-12 10:27:24 +02:00
|
|
|
maintainers = with maintainers; [ hardselius ];
|
2022-10-01 11:54:00 +02:00
|
|
|
changelog = "https://github.com/turbot/steampipe/blob/v${version}/CHANGELOG.md";
|
2021-10-12 10:27:24 +02:00
|
|
|
};
|
|
|
|
}
|