Skip to content

Commit

Permalink
Rewrite chart fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Goorzhel authored and farcaller committed Aug 14, 2024
1 parent 72466cd commit 8eb94b1
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,22 @@
poetry2nix.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, flake-utils, nix-kube-generators, poetry2nix, ... }: {
chartsMetadata = builtins.listToAttrs (map
(repo: {
name = repo;
value =
let
charts = builtins.attrNames (builtins.readDir ./charts/${repo});
in
builtins.listToAttrs (map
(name: {
inherit name;
value = import ./charts/${repo}/${name};
})
charts);
})
(builtins.attrNames (builtins.readDir ./charts)));
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
builtins.mapAttrs
(
reponame: charts:
builtins.mapAttrs
(
chartname: chartspec:
(kubelib.downloadHelmChart (builtins.removeAttrs chartspec ["bogusVersion"]))
)
charts
)
self.chartsMetadata;
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};
Expand Down

0 comments on commit 8eb94b1

Please sign in to comment.