-
Notifications
You must be signed in to change notification settings - Fork 11
/
flake.nix
59 lines (54 loc) · 1.77 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
description = "A collection of kubernetes helm charts in a nix-digestable format.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
haumea = {
url = "github:nix-community/haumea/v0.2.2";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-kube-generators.url = "github:farcaller/nix-kube-generators";
poetry2nix.url = "github:nix-community/poetry2nix";
poetry2nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, haumea, nixpkgs, flake-utils, nix-kube-generators, poetry2nix, ... }: {
chartsMetadata = haumea.lib.load {
src = ./charts;
transformer = haumea.lib.transformers.liftDefault;
};
charts = { pkgs }:
let
kubelib = nix-kube-generators.lib { inherit pkgs; };
trimBogusVersion = attrs: builtins.removeAttrs attrs ["bogusVersion"];
in
haumea.lib.load {
src = ./charts;
loader = {...}: p: kubelib.downloadHelmChart (trimBogusVersion (import p));
transformer = haumea.lib.transformers.liftDefault;
};
} // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryEnv mkPoetryApplication;
in
{
chartsDerivations = self.charts { inherit pkgs; };
packages.helmupdater = mkPoetryApplication {
python = pkgs.python312;
projectDir = ./.;
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
nixpkgs-fmt
poetry
python310Packages.autopep8
(mkPoetryEnv {
python = pkgs.python312;
projectDir = ./.;
editablePackageSources = {
manager = ./.;
};
})
];
};
});
}