1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/networking/cluster/kubeval/default.nix

49 lines
1.3 KiB
Nix
Raw Normal View History

2019-12-03 11:28:36 +00:00
{ stdenv, lib, fetchFromGitHub, buildGoModule, makeWrapper }:
2018-10-02 23:56:42 +01:00
let
# Cache schema as a package so network calls are not
# necessary at runtime, allowing use in package builds
2019-08-13 22:52:01 +01:00
schema = stdenv.mkDerivation {
2018-10-02 23:56:42 +01:00
name = "kubeval-schema";
src = fetchFromGitHub {
2019-12-03 11:28:36 +00:00
owner = "instrumenta";
2018-10-02 23:56:42 +01:00
repo = "kubernetes-json-schema";
2019-12-03 11:28:36 +00:00
rev = "6a498a60dc68c5f6a1cc248f94b5cd1e7241d699";
sha256 = "1y9m2ma3n4h7sf2lg788vjw6pkfyi0fa7gzc870faqv326n6x2jr";
2018-10-02 23:56:42 +01:00
};
installPhase = ''
mkdir -p $out/kubernetes-json-schema/master
cp -R . $out/kubernetes-json-schema/master
'';
};
in
2019-12-03 11:28:36 +00:00
buildGoModule rec {
pname = "kubeval";
2019-12-03 11:28:36 +00:00
version = "0.14.0";
2018-10-02 23:56:42 +01:00
src = fetchFromGitHub {
2019-12-03 11:28:36 +00:00
owner = "instrumenta";
2018-10-02 23:56:42 +01:00
repo = "kubeval";
2019-12-03 11:28:36 +00:00
rev = "${version}";
sha256 = "0kpwk7bv36m3i8vavm1pqc8l611c6l9qbagcc64v6r85qig4w5xv";
2018-10-02 23:56:42 +01:00
};
buildInputs = [ makeWrapper ];
2019-12-03 11:28:36 +00:00
modSha256 = "0y9x44y3bchi8xg0a6jmp2rmi8dybkl6qlywb6nj1viab1s8dd4y";
postFixup = "wrapProgram $out/bin/kubeval --set KUBEVAL_SCHEMA_LOCATION file:///${schema}/kubernetes-json-schema/master";
2018-10-02 23:56:42 +01:00
meta = with lib; {
description = "Validate your Kubernetes configuration files";
2019-12-03 11:28:36 +00:00
homepage = https://github.com/instrumenta/kubeval;
2018-10-02 23:56:42 +01:00
license = licenses.asl20;
maintainers = with maintainers; [ nicknovitski ];
platforms = platforms.all;
};
}