depot/third_party/nixpkgs/pkgs/tools/admin/fioctl/default.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

43 lines
1.2 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, fioctl }:
buildGoModule rec {
pname = "fioctl";
version = "0.41";
src = fetchFromGitHub {
owner = "foundriesio";
repo = "fioctl";
rev = "v${version}";
sha256 = "sha256-N+bLW1Gf0lr5FKgd1lr84HVrhdjB+npaeS3nzYXoVl0=";
};
vendorHash = "sha256-cu1TwCWdDQi2ZR96SvEeH/LIP7sZOVZoly3VczKZfRw=";
ldflags = [
"-s" "-w"
"-X github.com/foundriesio/fioctl/subcommands/version.Commit=${src.rev}"
];
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}";
};
meta = with lib; {
description = "A simple CLI to manage your Foundries Factory";
homepage = "https://github.com/foundriesio/fioctl";
license = licenses.asl20;
maintainers = with maintainers; [ nixinator matthewcroughan ];
mainProgram = "fioctl";
};
}