change to forgejo

This commit is contained in:
Ray Andrew 2024-10-11 23:43:54 -05:00
parent e1029a6db2
commit 5185603de3

View file

@ -7,7 +7,7 @@
}: }:
let let
giteaSshPort = 22; sshPort = 22;
in in
{ {
imports = [ imports = [
@ -109,14 +109,13 @@ in
# Git # Git
services = { services = {
gitea = { forgejo = {
enable = true; enable = true;
appName = "git.rs.ht"; appName = "git.rs.ht";
package = pkgs.gitea;
database.type = "sqlite3"; database.type = "sqlite3";
repositoryRoot = "/var/lib/gitea/repositories"; repositoryRoot = "/var/lib/forgejo/repositories";
lfs.enable = true; lfs.enable = true;
@ -124,7 +123,7 @@ in
# Is a nice feature once we have a dedicated backup storage. # Is a nice feature once we have a dedicated backup storage.
# For now it is disabled, since it delays `nixos-rebuild switch`. # For now it is disabled, since it delays `nixos-rebuild switch`.
enable = false; enable = false;
backupDir = "/var/lib/gitea/dump"; backupDir = "/var/lib/forgejo/dump";
}; };
settings = { settings = {
@ -132,7 +131,7 @@ in
ENABLED = true; ENABLED = true;
}; };
cors = { cors = {
ALLOW_DOMAIN = config.services.gitea.settings.server.DOMAIN; ALLOW_DOMAIN = config.services.forgejo.settings.server.DOMAIN;
ENABLED = true; ENABLED = true;
SCHEME = "https"; SCHEME = "https";
}; };
@ -173,8 +172,8 @@ in
ENABLE_GZIP = true; ENABLE_GZIP = true;
SSH_AUTHORIZED_KEYS_BACKUP = false; SSH_AUTHORIZED_KEYS_BACKUP = false;
SSH_DOMAIN = DOMAIN; SSH_DOMAIN = DOMAIN;
START_SSH_SERVER = giteaSshPort != 22; START_SSH_SERVER = sshPort != 22;
SSH_PORT = giteaSshPort; SSH_PORT = sshPort;
ROOT_URL = "https://${DOMAIN}/"; ROOT_URL = "https://${DOMAIN}/";
HTTP_PORT = 3003; HTTP_PORT = 3003;
}; };
@ -205,10 +204,14 @@ in
nginx = { nginx = {
enable = true; enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."git.rs.ht" = { virtualHosts."git.rs.ht" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/".proxyPass = "http://localhost:${toString config.services.gitea.settings.server.HTTP_PORT}"; locations."/".proxyPass = "http://localhost:${toString config.services.forgejo.settings.server.HTTP_PORT}";
}; };
}; };
@ -219,7 +222,7 @@ in
PasswordAuthentication = false; PasswordAuthentication = false;
}; };
extraConfig = '' extraConfig = ''
Match User gitea Match User forgejo
AllowAgentForwarding no AllowAgentForwarding no
AllowTcpForwarding no AllowTcpForwarding no
PermitTTY no PermitTTY no