stuff
This commit is contained in:
parent
e945e5c24b
commit
b9db4fa6c0
4 changed files with 10 additions and 217 deletions
|
@ -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 \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue