Created
November 4, 2018 19:48
-
-
Save johanot/005181caf5cb1889f71a68377de38d33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { 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); | |
| }; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call with
nix eval --arg deployment ./hostgroups/k8s.nix -f kubernixos.nix manifests --json.