feat: migrate gitea config to forgejo

This commit is contained in:
Inex Code 2024-06-30 22:15:30 +04:00
parent 2b2551e5ba
commit 2d047aa07f

View file

@ -52,11 +52,13 @@ in
options = [ "bind" ]; options = [ "bind" ];
}; };
}; };
services.gitea = { services.gitea.enable = false;
services.forgejo = {
enable = true; enable = true;
package = pkgs.forgejo; package = pkgs.forgejo;
inherit stateDir; inherit stateDir;
user = "gitea"; user = "gitea";
group = "gitea";
database = { database = {
type = "sqlite3"; type = "sqlite3";
host = "127.0.0.1"; host = "127.0.0.1";
@ -89,7 +91,7 @@ in
ENABLED = false; ENABLED = false;
}; };
ui = { ui = {
DEFAULT_THEME = "arc-green"; DEFAULT_THEME = "forgejo-auto";
SHOW_USER_EMAIL = false; SHOW_USER_EMAIL = false;
}; };
picture = { picture = {
@ -114,6 +116,13 @@ in
}; };
}; };
}; };
users.users.gitea = {
home = "${stateDir}";
useDefaultShell = true;
group = "gitea";
isSystemUser = true;
};
users.groups.gitea = { };
services.nginx.virtualHosts."${cfg.subdomain}.${sp.domain}" = { services.nginx.virtualHosts."${cfg.subdomain}.${sp.domain}" = {
useACMEHost = sp.domain; useACMEHost = sp.domain;
forceSSL = true; forceSSL = true;
@ -133,7 +142,7 @@ in
}; };
}; };
}; };
systemd.services.gitea.unitConfig.RequiresMountsFor = systemd.services.forgejo.unitConfig.RequiresMountsFor =
lib.mkIf sp.useBinds "/volumes/${cfg.location}/gitea"; lib.mkIf sp.useBinds "/volumes/${cfg.location}/gitea";
}; };
} }