1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2025-05-18 16:51:40 +02:00
parent e945e5c24b
commit b9db4fa6c0
No known key found for this signature in database
4 changed files with 10 additions and 217 deletions

View file

@ -64,23 +64,20 @@ in
secrets.mailer.PASSWD = secrets.forgejo-mailer.path;
};
# TODO
systemd.services.forgejo.preStart = lib.getExe (
pkgs.writeShellApplication {
name = "forgejo-init-admin";
runtimeInputs = [
cfg.package
];
text =
let
forgejoExe = lib.getExe cfg.package;
passwordFile = secrets.forgejo-admin.path;
in
''
admins=$(gitea admin user list --admin | wc --lines)
admins=$(${forgejoExe} admin user list --admin | wc --lines)
admins=$((admins - 1))
if ((admins < 1)); then
gitea admin user create \
${forgejoExe} admin user create \
--admin \
--email helvetica@helveticanonstandard.net \
--username helvetica \