diff options
author | Nick Novitski <nick@expo.io> | 2018-10-02 15:56:42 -0700 |
---|---|---|
committer | Nick Novitski <nick@expo.io> | 2018-10-04 13:52:45 -0700 |
commit | 78b9ab0713227419814504e367f2736e92940a62 (patch) | |
tree | 68db441d3f2dc1e82ba64021d792265570853925 /pkgs/applications/networking/cluster/kubeval/default.nix | |
parent | bae2f2dbda35912fe7d9e9cd0ce6e1e6335d8a34 (diff) |
kubeval: init at 0.7.3
Diffstat (limited to 'pkgs/applications/networking/cluster/kubeval/default.nix')
-rw-r--r-- | pkgs/applications/networking/cluster/kubeval/default.nix | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/kubeval/default.nix b/pkgs/applications/networking/cluster/kubeval/default.nix new file mode 100644 index 0000000000000..55a827f9cf920 --- /dev/null +++ b/pkgs/applications/networking/cluster/kubeval/default.nix @@ -0,0 +1,48 @@ +{ stdenv, lib, fetchFromGitHub, buildGoPackage, makeWrapper }: + +let + + # Cache schema as a package so network calls are not + # necessary at runtime, allowing use in package builds + schema = stdenv.mkDerivation rec { + name = "kubeval-schema"; + src = fetchFromGitHub { + owner = "garethr"; + repo = "kubernetes-json-schema"; + rev = "c7672fd48e1421f0060dd54b6620baa2ab7224ba"; + sha256 = "0picr3wvjx4qv158jy4f60pl225rm4mh0l97pf8nqi9h9x4x888p"; + }; + + installPhase = '' + mkdir -p $out/kubernetes-json-schema/master + cp -R . $out/kubernetes-json-schema/master + ''; + }; + +in + +buildGoPackage rec { + name = "kubeval-${version}"; + version = "0.7.3"; + + goPackagePath = "github.com/garethr/kubeval"; + src = fetchFromGitHub { + owner = "garethr"; + repo = "kubeval"; + rev = version; + sha256 = "042v4mc5p80vmk56wp6aw89yiibjnfqn79c0zcd6y179br4gpfnb"; + }; + goDeps = ./deps.nix; + + buildInputs = [ makeWrapper ]; + + postFixup = "wrapProgram $bin/bin/kubeval --set KUBEVAL_SCHEMA_LOCATION file:///${schema}"; + + meta = with lib; { + description = "Validate your Kubernetes configuration files"; + homepage = https://github.com/garethr/kubeval; + license = licenses.asl20; + maintainers = with maintainers; [ nicknovitski ]; + platforms = platforms.all; + }; +} |