From d5d46690aee5cd1934c9f136e3d65934eb4363a4 Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Wed, 17 Sep 2025 19:32:15 +0200 Subject: [PATCH 1/2] initial set up for zitadel module --- modules/sercice/zitadel/default.nix | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 modules/sercice/zitadel/default.nix diff --git a/modules/sercice/zitadel/default.nix b/modules/sercice/zitadel/default.nix new file mode 100644 index 0000000..028775b --- /dev/null +++ b/modules/sercice/zitadel/default.nix @@ -0,0 +1,68 @@ +{ ... }: +{ + _class = "clan.service"; + + manifest.name = "zitadel"; + + roles = { + controller = { + interface = { + options = {}; + }; + + perInstance = { instanceName, settings, machine, roles, ... }: { + nixosModule = { config }: { + config = { + services.zitadel.steps.${instanceName} = { + InstanceName = settings.hostName; + + Org = { + Name = settings.displayName; + Human = { + UserName = "chris"; + FirstName = "Chris"; + LastName = "Kruining"; + Email = { + Address = "chris@kruining.eu"; + Verified = true; + }; + Password = "KaasIsAwesome1!"; + }; + }; + }; + }; + }; + }; + }; + + peer = {}; + }; + + pweMachine = { instances, machine, ... }: { + nixosModule = { config, ... }: { + config = { + services.zitadel = { + enable = true; + + settings = { + Port = 9092; + + ExternalDomain = "auth.amarth.cloud"; + ExternalPort = 443; + ExternalSecure = true; + + Metrics.Type = "otel"; + Tracing.Type = "otel"; + Telemetry.Enabled = true; + + SystemDefaults = { + PasswordHasher.Hasher.Algorithm = "argon2id"; + SecretHasher.Hasher.Algorithm = "argon2id"; + }; + + }; + }; + }; + }; + }; +} From 7e0a5243647dceeb09ff3095938282370f4047d4 Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Wed, 17 Sep 2025 19:36:12 +0200 Subject: [PATCH 2/2] . --- flake.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 2a21e11..c97bb86 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Amarth Cloud's Clan services"; + description = "Clan services for use with Amarth Cloud"; inputs = { clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz"; @@ -23,13 +23,14 @@ { # inherit (clan.config) nixosConfigurations nixosModules clanInternals; # clan = clan.config; - + imports = [ clan-core.flakeModules.default # ./clanServices/flake-module.nix ]; clan.modules = { + "@amarth/zitadel" = flake-parts.lib.importApply ./modules/service/zitadel/default.nix {}; "@amarth/k3s" = flake-parts.lib.importApply ./clanServices/k3s/default.nix {}; }; @@ -47,4 +48,4 @@ }; }); }; -} \ No newline at end of file +}