Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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 # When updating version change rev.
13 version = "0.13.15";
14 rev = "b562392b12a78a11bcff9c6fca5a47146ea2ba0a";
15
16 src = fetchFromGitHub {
17 owner = "openfaas";
18 repo = "faas-cli";
19 rev = version;
20 sha256 = "15kjxn0p8nz8147vsm9q5q6wr2w5ssybvn247kynj2n7139iva2f";
21 };
22
23 CGO_ENABLED = 0;
24
25 vendorSha256 = null;
26
27 subPackages = [ "." ];
28
29 ldflags = [
30 "-s" "-w"
31 "-X github.com/openfaas/faas-cli/version.GitCommit=${rev}"
32 "-X github.com/openfaas/faas-cli/version.Version=${version}"
33 "-X github.com/openfaas/faas-cli/commands.Platform=${faasPlatform stdenv.targetPlatform}"
34 ];
35
36 meta = with lib; {
37 homepage = "https://github.com/openfaas/faas-cli";
38 description = "Official CLI for OpenFaaS ";
39 license = licenses.mit;
40 maintainers = with maintainers; [ welteki ];
41 platforms = [
42 "x86_64-linux"
43 "x86_64-darwin"
44 "aarch64-linux"
45 "aarch64-darwin"
46 "armv7l-linux"
47 "armv6l-linux"
48 ];
49 };
50}