nixos/kanidm: add support for kanidm unixd config v2

Co-authored-by: Sammy Etur <sammyetur11@gmail.com>
This commit is contained in:
Patrick
2025-12-03 19:38:42 +01:00
co-authored by Sammy Etur
parent ff5d4dfb67
commit 5af86e8cba
2 changed files with 14 additions and 2 deletions
+13 -1
View File
@@ -368,7 +368,7 @@ in
freeformType = settingsFormat.type;
options = {
pam_allowed_login_groups = mkOption {
kanidm.pam_allowed_login_groups = mkOption {
description = "Kanidm groups that are allowed to login using PAM.";
example = "my_pam_group";
type = types.listOf types.str;
@@ -673,6 +673,10 @@ in
config = mkIf (cfg.enableClient || cfg.enableServer || cfg.enablePam) {
warnings = lib.optionals (cfg.package.eolMessage != "") [ cfg.package.eolMessage ];
services.kanidm = {
unixSettings.version = "2";
serverSettings.version = "2";
};
assertions =
let
@@ -710,6 +714,14 @@ in
};
in
[
{
assertion = cfg.enablePam -> !(cfg.unixSettings ? pam_allowed_login_groups);
message = ''
<option>services.kanidm.unixSettings.pam_allowed_login_groups</option> has been renamed
to <option>services.kanidm.unixSettings.kanidm.pam_allowed_login_groups</option>.
Please change your usage.
'';
}
{
assertion =
!cfg.enableServer
+1 -1
View File
@@ -66,7 +66,7 @@ in
};
enablePam = true;
unixSettings = {
pam_allowed_login_groups = [ "shell" ];
kanidm.pam_allowed_login_groups = [ "shell" ];
};
};