Switched from gitea to forgejo

This commit is contained in:
alejandro-angulo 2024-10-26 16:22:03 -07:00
parent 4af7a4f0ee
commit 8790d60312
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
2 changed files with 20 additions and 17 deletions

View file

@ -7,11 +7,11 @@
}: let
inherit (lib) mkIf mkEnableOption mkOption types;
cfg = config.${namespace}.services.gitea;
gitea_cfg = config.services.gitea;
cfg = config.${namespace}.services.forgejo;
forgejo_cfg = config.services.forgejo;
in {
options.${namespace}.services.gitea = {
enable = mkEnableOption "gitea";
options.${namespace}.services.forgejo = {
enable = mkEnableOption "forgejo";
acmeCertName = mkOption {
type = types.str;
default = "";
@ -23,19 +23,18 @@ in {
};
config = mkIf cfg.enable {
services.gitea = {
services.forgejo = {
enable = true;
appName = "Internal Gitea server";
database = {
type = "postgres";
type = "sqlite3";
};
useWizard = false;
settings = {
server = {
DOMAIN = "gitea.kilonull.com";
ROOT_URL = "https://gitea.kilonull.com";
DOMAIN = "git.kilonull.com";
ROOT_URL = "https://git.kilonull.com";
HTTP_PORT = 3001;
};
@ -47,23 +46,27 @@ in {
ui.THEMES = ''
catppuccin-latte-rosewater,catppuccin-latte-flamingo,catppuccin-latte-pink,catppuccin-latte-mauve,catppuccin-latte-red,catppuccin-latte-maroon,catppuccin-latte-peach,catppuccin-latte-yellow,catppuccin-latte-green,catppuccin-latte-teal,catppuccin-latte-sky,catppuccin-latte-sapphire,catppuccin-latte-blue,catppuccin-latte-lavender,catppuccin-frappe-rosewater,catppuccin-frappe-flamingo,catppuccin-frappe-pink,catppuccin-frappe-mauve,catppuccin-frappe-red,catppuccin-frappe-maroon,catppuccin-frappe-peach,catppuccin-frappe-yellow,catppuccin-frappe-green,catppuccin-frappe-teal,catppuccin-frappe-sky,catppuccin-frappe-sapphire,catppuccin-frappe-blue,catppuccin-frappe-lavender,catppuccin-macchiato-rosewater,catppuccin-macchiato-flamingo,catppuccin-macchiato-pink,catppuccin-macchiato-mauve,catppuccin-macchiato-red,catppuccin-macchiato-maroon,catppuccin-macchiato-peach,catppuccin-macchiato-yellow,catppuccin-macchiato-green,catppuccin-macchiato-teal,catppuccin-macchiato-sky,catppuccin-macchiato-sapphire,catppuccin-macchiato-blue,catppuccin-macchiato-lavender,catppuccin-mocha-rosewater,catppuccin-mocha-flamingo,catppuccin-mocha-pink,catppuccin-mocha-mauve,catppuccin-mocha-red,catppuccin-mocha-maroon,catppuccin-mocha-peach,catppuccin-mocha-yellow,catppuccin-mocha-green,catppuccin-mocha-teal,catppuccin-mocha-sky,catppuccin-mocha-sapphire,catppuccin-mocha-blue,catppuccin-mocha-lavender
'';
ui.DEFAULT_THEME = "catppuccin-mocha-green";
};
};
systemd.tmpfiles.rules = [
"d '${gitea_cfg.customDir}/public' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -"
"z '${gitea_cfg.customDir}/public' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -"
"d '${gitea_cfg.customDir}/public/assets' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -"
"z '${gitea_cfg.customDir}/public/assets' 0750 ${gitea_cfg.user} ${gitea_cfg.group} - -"
"L+ '${gitea_cfg.customDir}/public/assets/css' - - - - ${pkgs.aa.catppuccin-gitea}/share/gitea-themes"
"d '${forgejo_cfg.customDir}/public' 0750 ${forgejo_cfg.user} ${forgejo_cfg.group} - -"
"z '${forgejo_cfg.customDir}/public' 0750 ${forgejo_cfg.user} ${forgejo_cfg.group} - -"
"d '${forgejo_cfg.customDir}/public/assets' 0750 ${forgejo_cfg.user} ${forgejo_cfg.group} - -"
"z '${forgejo_cfg.customDir}/public/assets' 0750 ${forgejo_cfg.user} ${forgejo_cfg.group} - -"
"L+ '${forgejo_cfg.customDir}/public/assets/css' - - - - ${pkgs.aa.catppuccin-gitea}/share/gitea-themes"
];
services.nginx = {
enable = true;
virtualHosts."gitea.kilonull.com" =
virtualHosts."git.kilonull.com" =
{
locations."/" = {
proxyPass = "http://127.0.0.1:${toString gitea_cfg.settings.server.HTTP_PORT}";
proxyPass = "http://127.0.0.1:${toString forgejo_cfg.settings.server.HTTP_PORT}";
};
locations."= /" = {
return = "301 /explore/repos";
};
}
// lib.optionalAttrs (cfg.acmeCertName != "") {

View file

@ -50,7 +50,7 @@
};
acmeCertName = "kilonull.com";
};
services.gitea = {
services.forgejo = {
enable = true;
acmeCertName = "kilonull.com";
};