mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
708e537c7c
Reading things like `lib.builders.buildHelmChart` got exhausting.
37 lines
648 B
Nix
37 lines
648 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 ? {},
|
|
}:
|
|
builders.helmChart {
|
|
inherit name namespace;
|
|
chart = charts.bjw-s.app-template;
|
|
values =
|
|
pkgs.lib.attrsets.recursiveUpdate
|
|
{
|
|
controllers.main.containers.main.image =
|
|
imageAttrs mainImage;
|
|
}
|
|
values;
|
|
};
|
|
}
|