add renamed options for guided migration

This commit is contained in:
ibizaman 2025-08-15 10:13:13 +02:00 committed by Pierre Penninckx
parent 133ddbbd7b
commit b8b940e9ff
3 changed files with 27 additions and 0 deletions

View file

@ -304,6 +304,9 @@ in
};
};
imports = [
(lib.mkRenamedOptionModule [ "shb" "ldap" ] [ "shb" "lldap" ])
];
config = lib.mkIf cfg.enable {

View file

@ -346,6 +346,18 @@ in
};
};
imports = [
(lib.mkRemovedOptionModule [ "shb" "forgejo" "adminPassword" ] ''Instead, define an admin user in shb.forgejo.users and give it the same password, like so:
shb.forgejo.users = {
"forgejoadmin" = {
isAdmin = true;
email = "forgejoadmin@example.com";
password.result = <path/to/password>;
};
};
'')
];
config = mkMerge [
(mkIf cfg.enable {
services.forgejo = {

View file

@ -91,6 +91,7 @@ in
admin = lib.mkOption {
description = "Default admin user info. Only needed if LDAP or SSO is not configured.";
default = null;
type = types.nullOr (types.submodule {
options = {
username = lib.mkOption {
@ -253,7 +254,18 @@ in
};
};
imports = [
(lib.mkRenamedOptionModule [ "shb" "jellyfin" "adminPassword" ] [ "shb" "jellyfin" "admin" "password" ])
];
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = (!cfg.ldap.enable && !cfg.sso.enable) -> cfg.admin != null;
message = "Jellyfin admin user must be configured with shb.jellyfin.admin if LDAP or SSO integration are not configured.";
}
];
services.jellyfin.enable = true;
networking.firewall = {