2 Commits

Author SHA1 Message Date
javalsai 78df628955 nixos/services: add gitea server
Check / Nix flake (push) Failing after 9s
Lint / Nix expressions (push) Failing after 11s
2026-05-03 18:25:42 -04:00
javalsai fae8f3580a nixos/services: add nginx base configuration 2026-05-03 18:25:42 -04:00
4 changed files with 72 additions and 2 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ in
extraHosts =
let
subdomains = [ "" ];
subdomains = [ "" ".git" ];
in
builtins.foldl' (
hosts-acc: domain-prefix:
+3 -1
View File
@@ -1,9 +1,11 @@
{
imports = [
./fail2ban.nix
./sysctl.nix
./gitea.nix
./host.nix
./nginx.nix
./snapper.nix
./substituters.nix
./sysctl.nix
];
}
+27
View File
@@ -0,0 +1,27 @@
{ config, lib, ... }:
{
services.gitea = {
enable = true;
appName = "Tuxcord's Gitea";
database.type = "mysql";
lfs.enable = true;
settings.server.DOMAIN = config.networking.fqdn;
# settings.server.ROOT_URL = "https://git.tuxcord.net/"; ? would also depend on ssl status
settings.server.HTTP_PORT = 3000;
settings.service.DISABLE_REGISTRATION = true;
settings.service.REQUIRE_SIGNIN_VIEW = false;
settings.repository.ENABLE_PUSH_CREATE_USER = true;
settings.repository.ENABLE_PUSH_CREATE_ORG = true;
settings.repository.DEFAULT_BRANCH = "main";
# settings.ui.DEFAULT_THEME = "...";
# TODO: once we have email setup this would be nice
settings.mailer.ENABLED = true;
};
}
+41
View File
@@ -0,0 +1,41 @@
{ config, ... }:
let
inherit (config.networking) fqdn;
mkVhost =
attrs:
{
forceSSL = false; # TODO: tweak per host
}
// attrs;
mkProxy = port: {
proxyPass = "http://127.0.0.1:${toString port}/";
};
in
{
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
# services.nginx.virtualHosts."${fqdn}" = {
# addSSL = true;
# root = "/var/www/myhost.org";
# default = true;
# };
virtualHosts."git.${fqdn}" = mkVhost {
locations."/" = mkProxy config.services.gitea.settings.server.HTTP_PORT;
};
};
networking.firewall.allowedTCPPorts = [
80
443
];
}