1
0
Fork 0
hscloud/ops/exports.nix

15 lines
506 B
Nix
Raw Normal View History

{ hscloud, pkgs, hscloudForPkgs, ... }:
{
# Used by clustercfg to figure out which machines need kube certs.
kubeMachineNames = let
isKubeMachine = n: value:
n != "__readTree" &&
(builtins.hasAttr "hscloud" value.options) &&
(builtins.hasAttr "kube" value.options.hscloud) &&
value.options.hscloud.kube.control.enable.value;
machines = pkgs.lib.filterAttrs isKubeMachine hscloud.ops.machines;
names = pkgs.lib.mapAttrsToList (name: _: name) machines;
in names;
}