mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 09:13:17 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
69 lines
1.6 KiB
Nix
69 lines
1.6 KiB
Nix
{ buildGoModule
|
|
, coreutils
|
|
, fetchFromGitHub
|
|
, git
|
|
, installShellFiles
|
|
, kubectl
|
|
, kubernetes-helm
|
|
, lib
|
|
, makeWrapper
|
|
, yamale
|
|
, yamllint
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "chart-testing";
|
|
version = "3.11.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "helm";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-eiU8omDEGDJVmumHwZkNix7qMVkoR6Irg0x9dTBzadA=";
|
|
};
|
|
|
|
vendorHash = "sha256-o9oZnQPztrK6HvclPt33Y05GQFWDsnUYti5x8R7aWS8=";
|
|
|
|
postPatch = ''
|
|
substituteInPlace pkg/config/config.go \
|
|
--replace "\"/etc/ct\"," "\"$out/etc/ct\","
|
|
'';
|
|
|
|
ldflags = [
|
|
"-w"
|
|
"-s"
|
|
"-X github.com/helm/chart-testing/v3/ct/cmd.Version=${version}"
|
|
"-X github.com/helm/chart-testing/v3/ct/cmd.GitCommit=${src.rev}"
|
|
"-X github.com/helm/chart-testing/v3/ct/cmd.BuildDate=19700101-00:00:00"
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
|
|
|
postInstall = ''
|
|
install -Dm644 -t $out/etc/ct etc/chart_schema.yaml
|
|
install -Dm644 -t $out/etc/ct etc/lintconf.yaml
|
|
|
|
installShellCompletion --cmd ct \
|
|
--bash <($out/bin/ct completion bash) \
|
|
--zsh <($out/bin/ct completion zsh) \
|
|
--fish <($out/bin/ct completion fish) \
|
|
|
|
wrapProgram $out/bin/ct --prefix PATH : ${lib.makeBinPath [
|
|
coreutils
|
|
git
|
|
kubectl
|
|
kubernetes-helm
|
|
yamale
|
|
yamllint
|
|
]}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Tool for testing Helm charts";
|
|
homepage = "https://github.com/helm/chart-testing";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ atkinschang ];
|
|
mainProgram = "ct";
|
|
};
|
|
}
|