Add vendor fetch

This commit is contained in:
muon 2026-03-20 14:44:24 +00:00
parent bf93912b39
commit 2d02ac206f
10 changed files with 360 additions and 46 deletions

View file

@ -0,0 +1,51 @@
{
lib,
stdenv,
buildGoModule,
sources,
makeWrapper,
installShellFiles,
pkg-config,
openssl,
xz,
go,
}:
let
src = sources.mender-cli;
in
buildGoModule {
inherit (src) pname version src vendorHash;
nativeBuildInputs = [
makeWrapper
installShellFiles
pkg-config
];
buildInputs = [
openssl
xz
];
allowGoReference = true;
postFixup = ''
wrapProgram "$out/bin/mender-cli" \
--prefix PATH : ${go}/bin
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd mender-cli \
--bash <($out/bin/mender-cli completion bash) \
--fish <($out/bin/mender-cli completion fish) \
--zsh <($out/bin/mender-cli completion zsh) \
'';
meta = {
description = "Mender CLI tool to simplify integration between the Mender server and cloud services like continuous integration (CI)/build automation";
mainProgram = "mender-cli";
homepage = "https://github.com/mendersoftware/mender-cli/";
changelog = "https://github.com/mendersoftware/mender-cli/releases/tag/${src.version}";
license = lib.licenses.asl20;
};
}