commit
This commit is contained in:
parent
488c490b53
commit
b09dcaa346
2 changed files with 25 additions and 9 deletions
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
den.aspects = {
|
||||
neru = {
|
||||
nixos =
|
||||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
sops.secrets.forgejo-admin-password.owner = "forgejo";
|
||||
systemd.services.forgejo.preStart =
|
||||
let
|
||||
adminCmd = "${lib.getExe cfg.package} admin user";
|
||||
pwd = config.sops.secrets.forgejo-admin-password;
|
||||
user = "exp";
|
||||
in ''
|
||||
${adminCmd} create --admin --email "root@localhost" --username ${user} --password "$(tr -d '\n' < ${pwd.path})" || true
|
||||
## uncomment this line to change an admin user which was already created
|
||||
# ${adminCmd} change-password --username ${user} --password "$(tr -d '\n' < ${pwd.path})" || true
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue