2022-07-14 12:49:19 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, fioctl }:
|
2021-03-20 04:20:00 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "fioctl";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "0.30.1";
|
2021-03-20 04:20:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "foundriesio";
|
|
|
|
repo = "fioctl";
|
|
|
|
rev = "v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
sha256 = "sha256-ocbTYeVhYTDyOJt3NndQhgz18xJWRudJRKel4WKS7vA=";
|
2021-03-20 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
vendorSha256 = "sha256-g8sTQXUk162SlA1iLEMGZ6O3FvF+8v/XINtZR8o0m8U=";
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
2022-07-14 12:49:19 +00:00
|
|
|
"-s" "-w"
|
|
|
|
"-X github.com/foundriesio/fioctl/subcommands/version.Commit=${src.rev}"
|
2021-08-27 14:25:00 +00:00
|
|
|
];
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd fioctl \
|
|
|
|
--bash <($out/bin/fioctl completion bash) \
|
|
|
|
--fish <($out/bin/fioctl completion fish) \
|
|
|
|
--zsh <($out/bin/fioctl completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = fioctl;
|
|
|
|
command = "HOME=$(mktemp -d) fioctl version";
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
meta = with lib; {
|
2022-07-14 12:49:19 +00:00
|
|
|
description = "A simple CLI to manage your Foundries Factory";
|
2021-03-20 04:20:00 +00:00
|
|
|
homepage = "https://github.com/foundriesio/fioctl";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ nixinator matthewcroughan ];
|
|
|
|
};
|
|
|
|
}
|