mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
38 lines
682 B
Nix
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;
|
|
};
|
|
}
|