1
0
Fork 0
mirror of https://git.sr.ht/~goorzhel/turboprop synced 2024-12-14 11:37:37 +00:00
turboprop/lib/app-template.nix

40 lines
725 B
Nix
Raw Normal View History

{
builders,
charts,
pkgs,
}: let
in rec {
2023-11-19 19:46:27 +00:00
imageAttrs = string:
with builtins; let
vals = split ":" string;
in {
repository = elemAt vals 0;
tag = elemAt vals 2;
};
mkExistingClaim = pvc: subPath: {
existingClaim = pvc;
inherit subPath;
};
build = {
namespace,
name,
mainImage,
values ? {},
apiVersions ? [],
kubeVersion ? pkgs.kubernetes.version,
}:
builders.helmChart {
inherit name namespace apiVersions;
chart = charts.bjw-s.app-template;
values =
pkgs.lib.attrsets.recursiveUpdate
{
controllers.main.containers.main.image =
2023-11-19 19:46:27 +00:00
imageAttrs mainImage;
}
2023-11-19 19:46:27 +00:00
values;
};
2023-11-18 10:08:23 +00:00
}