3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/cluster/fluxcd/default.nix

71 lines
1.8 KiB
Nix
Raw Normal View History

2021-03-18 22:45:03 +00:00
{ lib, buildGoModule, fetchFromGitHub, fetchzip, installShellFiles }:
let
2021-12-15 05:34:42 +00:00
version = "0.24.1";
sha256 = "18jzf5kd06c10f45y4crvaqa5r10dhq2ashlhppzrmhigiyavxac";
manifestsSha256 = "0qbdik65irnwgw7klj5w0z00jxflm855gikpnqb9gsxd7rbw8ysk";
2021-03-18 22:45:03 +00:00
manifests = fetchzip {
2021-12-07 12:55:20 +00:00
url =
"https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
sha256 = manifestsSha256;
2021-03-18 22:45:03 +00:00
stripRoot = false;
};
2021-12-07 12:55:20 +00:00
in buildGoModule rec {
pname = "fluxcd";
inherit version;
src = fetchFromGitHub {
owner = "fluxcd";
repo = "flux2";
rev = "v${version}";
inherit sha256;
};
2021-12-15 05:34:42 +00:00
vendorSha256 = "sha256-HoAVdY+kZLpUEl3mE7obbTzAJUyt5MBPjGhs6ZDSnzU=";
2021-10-23 13:37:32 +01:00
postUnpack = ''
cp -r ${manifests} source/cmd/flux/manifests
'';
2021-12-07 12:55:20 +00:00
patches = [ ./patches/disable-tests-ssh_key.patch ];
2021-08-26 07:45:51 +01:00
ldflags = [ "-s" "-w" "-X main.VERSION=${version}" ];
2021-10-23 13:37:32 +01:00
subPackages = [ "cmd/flux" ];
2021-03-18 22:45:03 +00:00
2021-08-27 13:28:40 +01:00
# Required to workaround test error:
# panic: mkdir /homeless-shelter: permission denied
2021-12-07 12:55:20 +00:00
HOME = "$TMPDIR";
2021-08-27 13:28:40 +01:00
2021-10-23 13:37:32 +01:00
nativeBuildInputs = [ installShellFiles ];
2021-01-27 15:09:39 +00:00
doInstallCheck = true;
installCheckPhase = ''
$out/bin/flux --version | grep ${version} > /dev/null
'';
postInstall = ''
for shell in bash fish zsh; do
$out/bin/flux completion $shell > flux.$shell
installShellCompletion flux.$shell
done
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
2021-12-07 12:55:20 +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 bryanasdev000 ];
};
}