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
2023-11-20 19:31:14 -08:00

38 lines
682 B
Nix

{
builders,
charts,
pkgs,
}: let
in rec {
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 ? [],
}:
builders.helmChart {
inherit name namespace apiVersions;
chart = charts.bjw-s.app-template;
values =
pkgs.lib.attrsets.recursiveUpdate
{
controllers.main.containers.main.image =
imageAttrs mainImage;
}
values;
};
}