1{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, fioctl }:
2
3buildGoModule rec {
4 pname = "fioctl";
5 version = "0.32.0";
6
7 src = fetchFromGitHub {
8 owner = "foundriesio";
9 repo = "fioctl";
10 rev = "v${version}";
11 sha256 = "sha256-3k3FoRU1yCtntVe3WTGUuhIBTD6KRvSsDISbjmNvzQI=";
12 };
13
14 vendorHash = "sha256-hSllpWjiYOBbANCX7usdAAF1HNAJ79ELK92qEyn8G1c=";
15
16 ldflags = [
17 "-s" "-w"
18 "-X github.com/foundriesio/fioctl/subcommands/version.Commit=${src.rev}"
19 ];
20
21 nativeBuildInputs = [ installShellFiles ];
22
23 postInstall = ''
24 installShellCompletion --cmd fioctl \
25 --bash <($out/bin/fioctl completion bash) \
26 --fish <($out/bin/fioctl completion fish) \
27 --zsh <($out/bin/fioctl completion zsh)
28 '';
29
30 passthru.tests.version = testers.testVersion {
31 package = fioctl;
32 command = "HOME=$(mktemp -d) fioctl version";
33 version = "v${version}";
34 };
35
36 meta = with lib; {
37 description = "A simple CLI to manage your Foundries Factory";
38 homepage = "https://github.com/foundriesio/fioctl";
39 license = licenses.asl20;
40 maintainers = with maintainers; [ nixinator matthewcroughan ];
41 };
42}