diff --git a/clanServices/k3s/default.nix b/clanServices/k3s/default.nix index c0aa1df..20c0628 100644 --- a/clanServices/k3s/default.nix +++ b/clanServices/k3s/default.nix @@ -18,7 +18,7 @@ in roles.server = { interface = { lib, ... }: let - inherit (lib) mkOption types toString; + inherit (lib) mkOption mkEnableOption mkIf types toString; in { options = { @@ -31,6 +31,9 @@ in ''; }; + harbor.enable = mkEnableOption "Enable Harbor - container registry"; + crossplane.enable = mkEnableOption "Enable Crossplane - control plane"; + crossplane.resources.composite = mkOption { type = with types; listOf (either path attrs); default = []; @@ -63,24 +66,15 @@ in Temporary option till I figure out something useful ''; }; - - # crossplane.resources.managed = mkOption { - # type = with types; listOf (either path attrs); - # default = []; - # example = lib.literalExpression '' - # [ - # ../manifests/my-managed-resource.yml - # ]; - # ''; - # description = '' - # Temporary option till I figure out something useful - # ''; - # }; }; }; perInstance = { instanceName, settings, machine, roles, ... }: { - nixosModule = { config, pkgs, ... }: { + nixosModule = { config, pkgs, lib, ... }: + let + inherit (lib) mkOption mkEnableOption mkIf types toString; + in + { environment.systemPackages = with pkgs; [ k9s linkerd ]; clan.core.vars.generators.k3s = { @@ -126,7 +120,7 @@ in clusterInit = true; autoDeployCharts = { - harbor = { + harbor = mkIf settings.harbor.enable { name = "harbor"; repo = "https://helm.goharbor.io"; version = "1.14.0"; @@ -147,7 +141,7 @@ in }; }; - crossplane = { + crossplane = mkIf settings.crossplane.enable { name = "crossplane"; repo = "https://charts.crossplane.io/stable"; version = "2.0.2";