mirror of
https://git.sr.ht/~goorzhel/turboprop
synced 2024-12-14 11:37:37 +00:00
5676e155cd
I forgot that all of `./lib/` is hidden.
60 lines
1.5 KiB
Nix
60 lines
1.5 KiB
Nix
{
|
|
description = "Templates Helm deployments using Nix";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
haumea = {
|
|
url = "github:nix-community/haumea/v0.2.2";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nix-kube-generators.url = "github:farcaller/nix-kube-generators";
|
|
};
|
|
|
|
outputs = inputs @ {
|
|
self,
|
|
flake-utils,
|
|
haumea,
|
|
nix-kube-generators,
|
|
nixpkgs,
|
|
}:
|
|
{
|
|
templates.default = {
|
|
path = ./templates/default;
|
|
description = "Example Turboprop flake";
|
|
};
|
|
}
|
|
// flake-utils.lib.eachDefaultSystem (system: let
|
|
pkgs = import nixpkgs {inherit system;};
|
|
kubelib = nix-kube-generators.lib {inherit pkgs;};
|
|
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 = {
|
|
mkDerivation = {
|
|
charts,
|
|
user ? {},
|
|
}:
|
|
(import self {
|
|
inherit charts haumea lib pkgs user;
|
|
})
|
|
.mkDerivation;
|
|
|
|
app-template = lib.app-template;
|
|
|
|
inherit mkCharts;
|
|
mkChartsWithNixhelm = src: nh:
|
|
pkgs.lib.attrsets.recursiveUpdate
|
|
nh.chartsDerivations.${system}
|
|
(mkCharts src);
|
|
};
|
|
|
|
formatter = pkgs.alejandra;
|
|
});
|
|
}
|