2021-03-18 22:45:03 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }:
|
|
|
|
|
|
|
|
let
|
2021-07-09 08:49:46 +01:00
|
|
|
version = "0.16.1";
|
2021-03-18 22:45:03 +00:00
|
|
|
|
|
|
|
manifests = fetchzip {
|
|
|
|
url = "https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
|
2021-06-22 19:22:28 +01:00
|
|
|
sha256 = "sha256-/uD0hxtTJSr+2tZcwzOIQcEbikHOshWukEBSaK3FiP4=";
|
2021-03-18 22:45:03 +00:00
|
|
|
stripRoot = false;
|
|
|
|
};
|
|
|
|
in
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
2021-03-18 22:45:03 +00:00
|
|
|
inherit version;
|
|
|
|
|
2020-12-09 19:45:35 +00:00
|
|
|
pname = "fluxcd";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fluxcd";
|
|
|
|
repo = "flux2";
|
|
|
|
rev = "v${version}";
|
2021-07-09 08:49:46 +01:00
|
|
|
sha256 = "sha256-OjbyDg+3dSJco162NubK12pbmwib6uGlJQxVaJOzSig=";
|
2020-12-09 19:45:35 +00:00
|
|
|
};
|
|
|
|
|
2021-07-09 08:49:46 +01:00
|
|
|
vendorSha256 = "sha256-GPbuHv/Xi9sWWZ6SIlW8cm5bY1gTO41vygx2C8dEt0k=";
|
2020-12-09 19:45:35 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
subPackages = [ "cmd/flux" ];
|
|
|
|
|
|
|
|
buildFlagsArray = [ "-ldflags=-s -w -X main.VERSION=${version}" ];
|
|
|
|
|
2021-03-18 22:45:03 +00:00
|
|
|
postUnpack = ''
|
|
|
|
cp -r ${manifests} source/cmd/flux/manifests
|
|
|
|
'';
|
|
|
|
|
2021-01-27 15:09:39 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/flux --version | grep ${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
2020-12-09 19:45:35 +00:00
|
|
|
postInstall = ''
|
|
|
|
for shell in bash fish zsh; do
|
|
|
|
$out/bin/flux completion $shell > flux.$shell
|
|
|
|
installShellCompletion flux.$shell
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-09 19:45:35 +00:00
|
|
|
description = "Open and extensible continuous delivery solution for Kubernetes";
|
|
|
|
longDescription = ''
|
|
|
|
Flux is a tool for keeping Kubernetes clusters in sync
|
|
|
|
with sources of configuration (like Git repositories), and automating
|
|
|
|
updates to configuration when there is new code to deploy.
|
|
|
|
'';
|
|
|
|
homepage = "https://fluxcd.io";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ jlesquembre ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|