Skip to content

Instantly share code, notes, and snippets.

@johanot
Created November 4, 2018 19:48
Show Gist options
  • Select an option

  • Save johanot/005181caf5cb1889f71a68377de38d33 to your computer and use it in GitHub Desktop.

Select an option

Save johanot/005181caf5cb1889f71a68377de38d33 to your computer and use it in GitHub Desktop.
{ deployment }:
let
network = (import deployment).network;
pkgs = network.pkgs;
option = with pkgs.lib; mkOption {
type = types.listOf types.attrs;
};
merge = item: pkgs.lib.recursiveUpdate item {
metadata = {
labels = {
reconciler = "kubernixos";
};
};
};
in
{
manifests = {
apiVersion = "v1";
kind = "List";
items = map merge ((import "${toString pkgs.path}/nixos/lib/eval-config.nix" {
inherit pkgs;
modules = network.modules ++ [ ({ options.manifests = option; }) ];
}).config.manifests);
};
}
@johanot

johanot commented Nov 4, 2018

Copy link
Copy Markdown
Author

Call with nix eval --arg deployment ./hostgroups/k8s.nix -f kubernixos.nix manifests --json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment