nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 40 lines 1.0 kB view raw
1{ lib, stdenv, buildGoModule, fetchFromGitHub }: 2let 3 faasPlatform = platform: 4 let cpuName = platform.parsed.cpu.name; in { 5 "aarch64" = "arm64"; 6 "armv7l" = "armhf"; 7 "armv6l" = "armhf"; 8 }.${cpuName} or cpuName; 9in 10buildGoModule rec { 11 pname = "faas-cli"; 12 version = "0.14.4"; 13 14 src = fetchFromGitHub { 15 owner = "openfaas"; 16 repo = "faas-cli"; 17 rev = version; 18 sha256 = "sha256-hpQn1lEJP0FmU1jhmXDgV/11RbMdEqblLPIrTQLKLOc="; 19 }; 20 21 CGO_ENABLED = 0; 22 23 vendorSha256 = null; 24 25 subPackages = [ "." ]; 26 27 ldflags = [ 28 "-s" "-w" 29 "-X github.com/openfaas/faas-cli/version.GitCommit=ref/tags/${version}" 30 "-X github.com/openfaas/faas-cli/version.Version=${version}" 31 "-X github.com/openfaas/faas-cli/commands.Platform=${faasPlatform stdenv.targetPlatform}" 32 ]; 33 34 meta = with lib; { 35 homepage = "https://github.com/openfaas/faas-cli"; 36 description = "Official CLI for OpenFaaS "; 37 license = licenses.mit; 38 maintainers = with maintainers; [ welteki techknowlogick ]; 39 }; 40}