✨ darkone.service.idm
Kanidm (identity manager) DNF Service.
Online backup: one dump per night, 7 kept in /var/lib/kanidm/backups
(services.kanidm.server.settings.online_backup). Restorable only by the
same kanidm minor version: an upgrade still needs a cold copy.
Sub-modules (idm/):
replication.nix: multi-zone read-only replication, HCS to zone gateways;provision.nix: OAuth2 clients (template registry), groups and persons.
Replication (replication.nix)
Section titled “Replication (replication.nix)”Automatic, derived from where idm is declared:
- idm on the HCS only, or on a gateway without HCS: one instance;
- on the HCS and >= 1 zone gateway: the HCS supplies (WriteReplica), each idm gateway consumes.
Two-step bootstrap: just apply generates every replication certificate
(gateways stay WriteReplicaNoUI), then just idm-sync-certs + just apply
adds the partners and flips the gateways to ReadOnlyReplica.
Provisioning (provision.nix)
Section titled “Provisioning (provision.nix)”Every OIDC-capable service module contributes a client template to
darkone.service.idm.oauth2; one client is provisioned per (template,
instance), merged by clientId across zones. Never on a replication
consumer: it mirrors the HCS.
Options
Section titled “Options”- enable
boolEnable local SSO with Kanidm
darkone.service.idm.enable = false;idm/provision.nix
Section titled “idm/provision.nix”- oauth2
attrsOAuth2/OIDC client templates contributed by service modules. Kanidm provisions one client per matching entry innetwork.services, withclientId = dnfLib.oauth2ClientName.- enable
boolWhether to provision OAuth2 clients for this template. - clientName
nullOr strOverride the kanidm client name. Defaults to dnfLib.oauth2ClientName. - displayName
strHuman-readable name shown on the kanidm consent screen. - imageFile
pathApplication icon. Re-uploaded on every kanidm-provision run. - redirectPaths
listOf strOAuth2 redirect paths (one per accepted callback URL). - landingPath
strAuto-connect entry point path on the service. - enableLegacyCrypto
boolAllow legacy JWT signing algorithms (eg. RS256). - allowInsecureClientDisablePkce
boolDisable PKCE on the client (only for clients that do not implement it). - preferShortUsername
nullOr boolUse the short username (no domain) in thepreferred_usernameclaim. - extra
attrsExtra attributes merged into the provisioned client (claimMaps, etc).
- enable
darkone.service.idm = { oauth2.enable = true; oauth2.clientName = null; oauth2.displayName = null; oauth2.imageFile = null; oauth2.redirectPaths = [ ]; oauth2.landingPath = "/"; oauth2.enableLegacyCrypto = false; oauth2.allowInsecureClientDisablePkce = false; oauth2.preferShortUsername = null; oauth2.extra = { };};idm/replication.nix
Section titled “idm/replication.nix”- replication
rawReplication facts of this node.
darkone.service.idm.replication = { inherit isMainReplica isReplConsumer; };Source: modules/service/idm.nix 🡕