2021-10-28 06:52:43 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
|
|
|
|
let
|
|
|
|
faasPlatform = platform:
|
|
|
|
let cpuName = platform.parsed.cpu.name; in {
|
|
|
|
"aarch64" = "arm64";
|
|
|
|
"armv7l" = "armhf";
|
2021-12-06 16:07:01 +00:00
|
|
|
"armv6l" = "armhf";
|
2021-10-28 06:52:43 +00:00
|
|
|
}.${cpuName} or cpuName;
|
|
|
|
in
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "faas-cli";
|
|
|
|
# When updating version change rev.
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.14.1";
|
|
|
|
rev = "d94600d2d2be52a66e0a15c219634f3bcac27318";
|
2021-10-28 06:52:43 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openfaas";
|
|
|
|
repo = "faas-cli";
|
|
|
|
rev = version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "132m9kv7a4vv65n8y3sq1drks6n1pci9fhvq0s637imf2vxccxqr";
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-X github.com/openfaas/faas-cli/version.GitCommit=${rev}"
|
|
|
|
"-X github.com/openfaas/faas-cli/version.Version=${version}"
|
2021-12-06 16:07:01 +00:00
|
|
|
"-X github.com/openfaas/faas-cli/commands.Platform=${faasPlatform stdenv.targetPlatform}"
|
2021-10-28 06:52:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/openfaas/faas-cli";
|
|
|
|
description = "Official CLI for OpenFaaS ";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ welteki ];
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-linux"
|
|
|
|
"aarch64-darwin"
|
|
|
|
"armv7l-linux"
|
|
|
|
"armv6l-linux"
|
|
|
|
];
|
2021-10-28 06:52:43 +00:00
|
|
|
};
|
|
|
|
}
|