move generator jobs into pkgs

This commit is contained in:
Bryton Hall 2023-07-07 17:50:26 -04:00
parent 7a64a0f599
commit ef5f5b3c89
6 changed files with 2 additions and 14 deletions

View file

@ -0,0 +1,45 @@
{
pkgs,
lib,
}: let
generateIstio = import ./istio {
inherit
pkgs
lib
;
};
generateK8S = name: spec:
import ./k8s {
inherit
name
pkgs
lib
spec
;
};
in {
istio = pkgs.linkFarm "istio-generated" [
{
name = "latest.nix";
path = generateIstio;
}
];
k8s = pkgs.linkFarm "k8s-generated" (
builtins.attrValues (
builtins.mapAttrs (
version: sha: let
short = builtins.concatStringsSep "." (lib.lists.sublist 0 2 (builtins.splitVersion version));
in {
name = "v${short}.nix";
path = generateK8S "v${short}" (builtins.fetchurl {
url = "https://github.com/kubernetes/kubernetes/raw/v${version}/api/openapi-spec/swagger.json";
sha256 = sha;
});
}
)
(import ../../versions.nix).full
)
);
}