mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-08 14:40:19 +02:00
(feat): added users declaratively
This commit is contained in:
parent
bc7f6a9e4f
commit
8909f3fe6e
2 changed files with 12 additions and 3 deletions
|
@ -1,10 +1,12 @@
|
|||
{ config, ... }:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
imports = [ ./forgejo-smtp.nix ];
|
||||
sops.secrets.smtp_address = { };
|
||||
sops.secrets.smtp_password = {
|
||||
owner = "forgejo";
|
||||
};
|
||||
sops.secrets.forgejoInitialMail = { };
|
||||
sops.secrets.forgejoInitialPassword = { };
|
||||
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
|
@ -29,4 +31,9 @@
|
|||
};
|
||||
mailerPasswordFile = config.sops.secrets.smtp_password.path;
|
||||
};
|
||||
|
||||
systemd.services.forgejo.preStart = ''
|
||||
create="${lib.getExe config.services.forgejo.package} admin user create"
|
||||
$create --admin --email "`cat ${config.sops.secrets.forgejoInitialMail}`" --username you --password "`cat ${config.sops.secrets.forgejoInitialPassword.path}`" &>/dev/null || true
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue