fix: refactor improper use of mkIf

Apparently you should NOT do this, because not only will it not work, it
will also break the entire module!
This commit is contained in:
Kiana Sheibani 2025-01-10 22:02:53 -05:00
parent 79c0dfa162
commit 80834ea71c
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -45,13 +45,16 @@ in {
"L+ ${forgejo.stateDir}/custom/public/assets - - - - ${cfg.theme}" "L+ ${forgejo.stateDir}/custom/public/assets - - - - ${cfg.theme}"
++ lib.optional (!(builtins.isNull cfg.templates)) ++ lib.optional (!(builtins.isNull cfg.templates))
"L+ ${forgejo.stateDir}/custom/templates - - - - ${cfg.templates}"; "L+ ${forgejo.stateDir}/custom/templates - - - - ${cfg.templates}";
}
// lib.mkIf cfg.createUser { users.users = lib.mkIf cfg.createUser {
users.users.${forgejo.user} = { ${forgejo.user} = {
home = forgejo.stateDir; home = forgejo.stateDir;
useDefaultShell = true; useDefaultShell = true;
group = forgejo.group; group = forgejo.group;
isSystemUser = true; isSystemUser = true;
};
};
users.groups = lib.mkIf cfg.createUser {
${forgejo.group} = {};
}; };
users.groups.${forgejo.group} = {};
} }