nixpkgs/pkgs/by-name/fl/fluxcd/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
2.1 KiB
Nix
Raw Normal View History

{
buildGoModule,
fetchFromGitHub,
fetchzip,
installShellFiles,
lib,
stdenv,
2023-10-15 20:11:06 +00:00
}:
2021-03-18 22:45:03 +00:00
let
2024-05-16 01:20:03 +00:00
version = "2.3.0";
2024-09-14 22:01:59 +00:00
hash = "sha256-ZQs1rWI31qDo/BgjrmiNnEdR2OL8bUHVz+j5VceEp2k=";
2024-05-16 01:20:03 +00:00
manifestsSha256 = "sha256-PdhR+UDquIJWtpSymtT6V7qO5fVJOkFz6RGzAx7xeb4=";
2021-03-18 22:45:03 +00:00
manifests = fetchzip {
url = "https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
hash = manifestsSha256;
2021-03-18 22:45:03 +00:00
stripRoot = false;
};
in
buildGoModule rec {
pname = "fluxcd";
inherit version;
src = fetchFromGitHub {
owner = "fluxcd";
repo = "flux2";
rev = "v${version}";
2024-09-14 22:01:59 +00:00
inherit hash;
};
2024-05-16 01:20:03 +00:00
vendorHash = "sha256-0YH3pgFrsnh5jIsZpj/sIgfiOCTtIlPltMS5mdGz1eM=";
2021-10-23 12:37:32 +00:00
postUnpack = ''
cp -r ${manifests} source/cmd/flux/manifests
2023-03-21 11:46:10 +00:00
# disable tests that require network access
rm source/cmd/flux/create_secret_git_test.go
'';
ldflags = [
"-s"
"-w"
"-X main.VERSION=${version}"
];
2021-10-23 12:37:32 +00:00
subPackages = [ "cmd/flux" ];
2021-03-18 22:45:03 +00:00
2021-08-27 12:28:40 +00: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 12:28:40 +00:00
2021-10-23 12:37:32 +00:00
nativeBuildInputs = [ installShellFiles ];
2021-01-27 15:09:39 +00:00
doInstallCheck = true;
installCheckPhase = ''
$out/bin/flux --version | grep ${version} > /dev/null
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for shell in bash fish zsh; do
2024-07-15 15:03:40 +00:00
installShellCompletion --cmd flux \
--$shell <($out/bin/flux completion $shell)
done
'';
passthru.updateScript = ./update.sh;
meta = {
changelog = "https://github.com/fluxcd/flux2/releases/tag/v${version}";
description = "Open and extensible continuous delivery solution for Kubernetes";
downloadPage = "https://github.com/fluxcd/flux2/";
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 = lib.licenses.asl20;
maintainers = with lib.maintainers; [
bryanasdev000
jlesquembre
];
mainProgram = "flux";
};
}