Compare commits

..

No commits in common. "81e6c01444de13568aa82a68a7b1fbd83d022a20" and "992ffdd92e4751e830d012fd714fd70da9035281" have entirely different histories.

View file

@ -3,8 +3,6 @@ let
cfg = config.aether.forgejo; cfg = config.aether.forgejo;
forgejo = config.services.forgejo; forgejo = config.services.forgejo;
srv = forgejo.settings.server; srv = forgejo.settings.server;
useSubdomain = !(builtins.isNull cfg.subdomain);
in { in {
imports = [ ./options.nix ]; imports = [ ./options.nix ];
@ -24,7 +22,7 @@ in {
security.acme.defaults.email = cfg.acmeEmail; security.acme.defaults.email = cfg.acmeEmail;
networking.firewall.allowedTCPPorts = networking.firewall.allowedTCPPorts =
[ 80 443 ]; [ 80 ] ++ lib.optional config.aether.https 443;
# Forgejo # Forgejo
@ -35,15 +33,16 @@ in {
database.user = forgejo.user; database.user = forgejo.user;
settings.server = { settings.server = {
DOMAIN = lib.optionalString useSubdomain "${cfg.subdomain}." DOMAIN = lib.optionalString (!(builtins.isNull cfg.subdomain)) "${cfg.subdomain}."
+ config.aether.domain; + config.aether.domain;
ROOT_URL = "https://${srv.DOMAIN}/"; ROOT_URL = "https://${srv.DOMAIN}/";
}; };
}; };
systemd.tmpfiles.rules = systemd.tmpfiles.rules =
lib.optional useSubdomain lib.optional
"L+ ${forgejo.stateDir}/custom/templates - - - - ${cfg.templates}"; (!(builtins.isNull cfg.templates))
"L+ ${cfg.stateDir}/custom/templates - - - - ${cfg.templates}";
} }
// lib.mkIf cfg.createUser { // lib.mkIf cfg.createUser {
users.users.${forgejo.user} = { users.users.${forgejo.user} = {