fix(forgejo): fix possible duplicate user creation

This commit is contained in:
Kiana Sheibani 2025-03-29 07:25:16 -04:00
parent f7e030244b
commit 5b602799f6
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -46,7 +46,7 @@ in {
++ lib.optional (!(builtins.isNull cfg.templates))
"L+ ${forgejo.stateDir}/custom/templates - - - - ${cfg.templates}";
users.users = lib.mkIf cfg.createUser {
users.users = lib.mkIf (cfg.createUser && forgejo.user != "forgejo") {
${forgejo.user} = {
home = forgejo.stateDir;
useDefaultShell = true;
@ -54,7 +54,7 @@ in {
isSystemUser = true;
};
};
users.groups = lib.mkIf cfg.createUser {
users.groups = lib.mkIf (cfg.createUser && forgejo.group != "forgejo") {
${forgejo.group} = {};
};
}