mirror of
https://github.com/dhall-lang/dhall-kubernetes.git
synced 2024-11-05 02:26:39 +03:00
f4bf4b9ddf
Also generate version 1.18 along the way Fixes https://github.com/dhall-lang/dhall-kubernetes/issues/131
43 lines
1.1 KiB
Nix
43 lines
1.1 KiB
Nix
{ fetchurl, make-dhall-kubernetes-package, lib, stdenv }:
|
|
|
|
let
|
|
kubernetesDirectory = ./kubernetes;
|
|
|
|
kubernetesPaths = builtins.readDir kubernetesDirectory;
|
|
|
|
toKeyValue =
|
|
file: _:
|
|
let
|
|
version = builtins.replaceStrings [ ".txt" ] [ "" ] file;
|
|
|
|
in
|
|
{ name = version;
|
|
|
|
value =
|
|
let
|
|
spec =
|
|
stdenv.mkDerivation {
|
|
name = "kubernetes-${version}";
|
|
|
|
src =
|
|
fetchurl {
|
|
url = "https://github.com/kubernetes/kubernetes/archive/release-${version}.tar.gz";
|
|
|
|
sha256 =
|
|
builtins.replaceStrings [ "\n" ] [ "" ]
|
|
(builtins.readFile (kubernetesDirectory + "/${file}"));
|
|
};
|
|
|
|
phases = [ "unpackPhase" "installPhase" ];
|
|
|
|
installPhase = ''
|
|
cp api/openapi-spec/swagger.json $out
|
|
'';
|
|
};
|
|
in
|
|
make-dhall-kubernetes-package { inherit version spec; };
|
|
};
|
|
|
|
in
|
|
lib.mapAttrs' toKeyValue kubernetesPaths
|