2022-07-08 15:22:49 +02:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, fioctl }:
|
2021-03-11 04:23:52 +01:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "fioctl";
|
2024-02-29 21:36:16 +01:00
|
|
|
version = "0.41";
|
2021-03-11 04:23:52 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "foundriesio";
|
|
|
|
repo = "fioctl";
|
|
|
|
rev = "v${version}";
|
2024-02-29 21:36:16 +01:00
|
|
|
sha256 = "sha256-N+bLW1Gf0lr5FKgd1lr84HVrhdjB+npaeS3nzYXoVl0=";
|
2021-03-11 04:23:52 +01:00
|
|
|
};
|
|
|
|
|
2024-02-29 21:36:16 +01:00
|
|
|
vendorHash = "sha256-cu1TwCWdDQi2ZR96SvEeH/LIP7sZOVZoly3VczKZfRw=";
|
2021-03-11 04:23:52 +01:00
|
|
|
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [
|
2022-07-08 15:22:49 +02:00
|
|
|
"-s" "-w"
|
|
|
|
"-X github.com/foundriesio/fioctl/subcommands/version.Commit=${src.rev}"
|
2021-08-26 08:45:51 +02:00
|
|
|
];
|
2021-03-11 04:23:52 +01:00
|
|
|
|
2022-07-08 15:22:49 +02: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-11 04:23:52 +01:00
|
|
|
meta = with lib; {
|
2022-07-08 15:22:49 +02:00
|
|
|
description = "A simple CLI to manage your Foundries Factory";
|
2021-03-11 04:23:52 +01:00
|
|
|
homepage = "https://github.com/foundriesio/fioctl";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ nixinator matthewcroughan ];
|
2024-02-11 03:19:15 +01:00
|
|
|
mainProgram = "fioctl";
|
2021-03-11 04:23:52 +01:00
|
|
|
};
|
|
|
|
}
|