mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-11 00:04:11 +00:00
41 lines
1018 B
Nix
41 lines
1018 B
Nix
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
|
|
let
|
|
faasPlatform = platform:
|
|
let cpuName = platform.parsed.cpu.name; in {
|
|
"aarch64" = "arm64";
|
|
"armv7l" = "armhf";
|
|
"armv6l" = "armhf";
|
|
}.${cpuName} or cpuName;
|
|
in
|
|
buildGoModule rec {
|
|
pname = "faas-cli";
|
|
version = "0.14.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "openfaas";
|
|
repo = "faas-cli";
|
|
rev = version;
|
|
sha256 = "sha256-1aflQXfW/y31Dk0OZW77qNQKEwkhi6p8ZBfTUyRDbdo=";
|
|
};
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
vendorSha256 = null;
|
|
|
|
subPackages = [ "." ];
|
|
|
|
ldflags = [
|
|
"-s" "-w"
|
|
"-X github.com/openfaas/faas-cli/version.GitCommit=ref/tags/${version}"
|
|
"-X github.com/openfaas/faas-cli/version.Version=${version}"
|
|
"-X github.com/openfaas/faas-cli/commands.Platform=${faasPlatform stdenv.targetPlatform}"
|
|
];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/openfaas/faas-cli";
|
|
description = "Official CLI for OpenFaaS ";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ welteki ];
|
|
};
|
|
}
|