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

63 lines
1.6 KiB
Nix
Raw Normal View History

{
2023-11-28 06:16:02 +00:00
description = "Templates Helm deployments using Nix";
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";
};
nix-kube-generators.url = "github:farcaller/nix-kube-generators";
nixhelm = {
url = "github:farcaller/nixhelm";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
flake-utils,
haumea,
nix-kube-generators,
nixpkgs,
nixhelm,
2023-12-04 01:07:21 +00:00
}:
{
templates.default = {
path = ./templates/default;
description = "Example Turboprop flake";
};
}
// flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
2023-11-15 06:55:56 +00:00
kubelib = nix-kube-generators.lib {inherit pkgs;};
nixhelmCharts = nixhelm.chartsDerivations.${system};
lib = import ./lib {inherit kubelib pkgs;};
mkCharts = src:
haumea.lib.load {
inherit src;
loader = {...}: p: lib.fetchers.helmChart (import p);
transformer = haumea.lib.transformers.liftDefault;
};
in {
lib = lib // {
mkDerivation = {
charts,
userData ? {},
}:
2023-12-04 07:11:03 +00:00
(import self {
inherit charts haumea lib pkgs userData;
2023-12-05 03:39:28 +00:00
})
.mkDerivation;
inherit mkCharts;
mkChartsWithNixhelm = src:
pkgs.lib.attrsets.recursiveUpdate
nixhelmCharts
(mkCharts src);
};
});
}