2023-11-15 06:09:04 +00:00
|
|
|
{
|
2023-11-28 06:16:02 +00:00
|
|
|
description = "Templates Helm deployments using Nix";
|
2023-11-15 06:09:04 +00:00
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2023-12-04 01:07:21 +00:00
|
|
|
haumea = {
|
|
|
|
url = "github:nix-community/haumea/v0.2.2";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-11-27 07:41:14 +00:00
|
|
|
nix-kube-generators.url = "github:farcaller/nix-kube-generators";
|
2023-11-15 06:09:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = inputs @ {
|
|
|
|
self,
|
|
|
|
flake-utils,
|
2023-12-04 06:39:09 +00:00
|
|
|
haumea,
|
2023-11-15 06:09:04 +00:00
|
|
|
nix-kube-generators,
|
2023-12-04 06:39:09 +00:00
|
|
|
nixpkgs,
|
2023-12-04 01:07:21 +00:00
|
|
|
}:
|
2023-12-06 07:30:40 +00:00
|
|
|
{
|
|
|
|
templates.default = {
|
|
|
|
path = ./templates/default;
|
|
|
|
description = "Example Turboprop flake";
|
|
|
|
};
|
2023-12-07 05:42:07 +00:00
|
|
|
}
|
|
|
|
// flake-utils.lib.eachDefaultSystem (system: let
|
2023-11-27 07:41:14 +00:00
|
|
|
pkgs = import nixpkgs {inherit system;};
|
2023-11-15 06:55:56 +00:00
|
|
|
kubelib = nix-kube-generators.lib {inherit pkgs;};
|
2023-12-04 05:36:54 +00:00
|
|
|
lib = import ./lib {inherit kubelib pkgs;};
|
2023-12-04 06:39:09 +00:00
|
|
|
|
|
|
|
mkCharts = src:
|
|
|
|
haumea.lib.load {
|
|
|
|
inherit src;
|
|
|
|
loader = {...}: p: lib.fetchers.helmChart (import p);
|
|
|
|
transformer = haumea.lib.transformers.liftDefault;
|
|
|
|
};
|
2023-11-15 06:09:04 +00:00
|
|
|
in {
|
2023-12-04 07:05:42 +00:00
|
|
|
lib = {
|
|
|
|
mkDerivation = {
|
2023-12-07 05:42:07 +00:00
|
|
|
charts,
|
2023-12-04 07:05:42 +00:00
|
|
|
user ? {},
|
|
|
|
}:
|
2023-12-04 07:11:03 +00:00
|
|
|
(import self {
|
2023-12-04 07:05:42 +00:00
|
|
|
inherit charts haumea lib pkgs user;
|
2023-12-05 03:39:28 +00:00
|
|
|
})
|
|
|
|
.mkDerivation;
|
2023-12-04 06:39:09 +00:00
|
|
|
|
2023-12-07 07:09:27 +00:00
|
|
|
app-template = lib.app-template;
|
|
|
|
|
2023-12-04 07:05:42 +00:00
|
|
|
inherit mkCharts;
|
2023-12-06 07:24:26 +00:00
|
|
|
mkChartsWithNixhelm = src: nh:
|
2023-12-04 07:05:42 +00:00
|
|
|
pkgs.lib.attrsets.recursiveUpdate
|
2023-12-06 07:24:26 +00:00
|
|
|
nh.chartsDerivations.${system}
|
2023-12-04 07:05:42 +00:00
|
|
|
(mkCharts src);
|
2023-12-04 06:39:09 +00:00
|
|
|
};
|
2023-12-06 06:01:00 +00:00
|
|
|
|
2023-11-15 06:09:04 +00:00
|
|
|
formatter = pkgs.alejandra;
|
|
|
|
});
|
|
|
|
}
|