refactor: factor out forgejo
option
This commit is contained in:
parent
992ffdd92e
commit
f27c89de11
|
@ -3,6 +3,8 @@ let
|
|||
cfg = config.aether.forgejo;
|
||||
forgejo = config.services.forgejo;
|
||||
srv = forgejo.settings.server;
|
||||
|
||||
useSubdomain = !(builtins.isNull cfg.subdomain);
|
||||
in {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
|
@ -33,15 +35,14 @@ in {
|
|||
database.user = forgejo.user;
|
||||
|
||||
settings.server = {
|
||||
DOMAIN = lib.optionalString (!(builtins.isNull cfg.subdomain)) "${cfg.subdomain}."
|
||||
DOMAIN = lib.optionalString useSubdomain "${cfg.subdomain}."
|
||||
+ config.aether.domain;
|
||||
ROOT_URL = "https://${srv.DOMAIN}/";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules =
|
||||
lib.optional
|
||||
(!(builtins.isNull cfg.templates))
|
||||
lib.optional useSubdomain
|
||||
"L+ ${cfg.stateDir}/custom/templates - - - - ${cfg.templates}";
|
||||
}
|
||||
// lib.mkIf cfg.createUser {
|
||||
|
|
Loading…
Reference in a new issue