diff --git a/hosts/thor/services/forgejo/default.nix b/hosts/thor/services/forgejo/default.nix index 60b8d67..5c5976f 100755 --- a/hosts/thor/services/forgejo/default.nix +++ b/hosts/thor/services/forgejo/default.nix @@ -25,50 +25,7 @@ in { database.socket = "/run/postgresql"; secrets.mailer.PASSWD = config.age.secrets.smtpPassword.path; - settings = { - default.APP_NAME = "sador.me Forgejo"; - "cron.update_checker".ENABLED = false; - actions.ENABLED = true; - - service = { - DISABLE_REGISTRATION = true; - REQUIRE_SIGNIN_VIEW = false; - REGISTER_EMAIL_CONFIRM = true; - ENABLE_NOTIFY_MAIL = true; - ALLOW_ONLY_EXTERNAL_REGISTRATION = false; - DEFAULT_KEEP_EMAIL_PRIVATE = false; - DEFAULT_ALLOW_CREATE_ORGANIZATION = true; - DEFAULT_ENABLE_TIMETRACKING = true; - }; - - security = { - INSTALL_LOCK = true; - REVERSE_PROXY_LIMIT = 1; - REVERSE_PROXY_TRUSTED_PROXIES = "127.0.0.1"; - PASSWORD_HASH_ALGO = "pbkdf2"; - }; - - server = { - DOMAIN = "git." + prefs.config.thor.domain; - ROOT_URL = "https://git." + prefs.config.thor.domain; - HTTP_PORT = 3428; - DISABLE_SSH = true; - }; - - mailer = with prefs.config.thor.emailConfig; { - ENABLED = true; - SMTP_ADDR = server; - SMTP_PORT = port; - PROTOCOL = "smtp+${tls}"; - FROM = from; - USER = login; - }; - - ui = { - DEFAULT_THEME = "gitea-auto"; - THEMES = import ./theming.nix; - }; - }; + settings = import ./settings.nix { inherit prefs; }; }; # setup Catppuccin theme diff --git a/hosts/thor/services/forgejo/settings.nix b/hosts/thor/services/forgejo/settings.nix new file mode 100644 index 0000000..8343b91 --- /dev/null +++ b/hosts/thor/services/forgejo/settings.nix @@ -0,0 +1,45 @@ +{ prefs }: { + default.APP_NAME = "${prefs.config.thor.domain} Forgejo"; + "cron.update_checker".ENABLED = false; + actions.ENABLED = true; + + service = { + DISABLE_REGISTRATION = true; + REQUIRE_SIGNIN_VIEW = false; + REGISTER_EMAIL_CONFIRM = true; + ENABLE_NOTIFY_MAIL = true; + ALLOW_ONLY_EXTERNAL_REGISTRATION = false; + DEFAULT_KEEP_EMAIL_PRIVATE = false; + DEFAULT_ALLOW_CREATE_ORGANIZATION = true; + DEFAULT_ENABLE_TIMETRACKING = true; + }; + + security = { + INSTALL_LOCK = true; + REVERSE_PROXY_LIMIT = 1; + REVERSE_PROXY_TRUSTED_PROXIES = "127.0.0.1"; + PASSWORD_HASH_ALGO = "pbkdf2"; + }; + + server = { + DOMAIN = "git." + prefs.config.thor.domain; + ROOT_URL = "https://git." + prefs.config.thor.domain; + HTTP_PORT = 3428; + DISABLE_SSH = true; + ENABLE_PPROF = true; + }; + + mailer = with prefs.config.thor.emailConfig; { + ENABLED = true; + SMTP_ADDR = server; + SMTP_PORT = port; + PROTOCOL = "smtp+${tls}"; + FROM = from; + USER = login; + }; + + ui = { + DEFAULT_THEME = "gitea-auto"; + THEMES = import ./theming.nix; + }; +}