Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
80 lines
1.6 KiB
Nix
80 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
makeWrapper,
|
|
git,
|
|
installShellFiles,
|
|
testers,
|
|
faas-cli,
|
|
}:
|
|
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.17.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "openfaas";
|
|
repo = "faas-cli";
|
|
rev = version;
|
|
sha256 = "sha256-gyd9uX5i5nl7x476SGfBwWUL1hTLsPCCdsmwo783x5Q=";
|
|
};
|
|
|
|
vendorHash = null;
|
|
|
|
env.CGO_ENABLED = 0;
|
|
|
|
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.hostPlatform}"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
installShellFiles
|
|
];
|
|
|
|
postInstall = ''
|
|
wrapProgram "$out/bin/faas-cli" \
|
|
--prefix PATH : ${lib.makeBinPath [ git ]}
|
|
|
|
installShellCompletion --cmd metal \
|
|
--bash <($out/bin/faas-cli completion --shell bash) \
|
|
--zsh <($out/bin/faas-cli completion --shell zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
command = "${faas-cli}/bin/faas-cli version --short-version --warn-update=false";
|
|
package = faas-cli;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Official CLI for OpenFaaS";
|
|
mainProgram = "faas-cli";
|
|
homepage = "https://github.com/openfaas/faas-cli";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [
|
|
welteki
|
|
techknowlogick
|
|
];
|
|
};
|
|
}
|