machines/magenta: add gitea service

This commit is contained in:
Dmitriy Pleshevskiy 2022-10-15 08:39:47 +03:00
parent 9d266f6c73
commit bc9dbf0881
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
2 changed files with 42 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ config, ... }: { config, pkgs, ... }:
let let
data = import ../../data.nix; data = import ../../data.nix;
@ -10,6 +10,7 @@ in
./mail-accounts.nix ./mail-accounts.nix
../modules/common.nix ../modules/common.nix
../modules/nix.nix ../modules/nix.nix
../modules/nginx.nix
]; ];
boot.cleanTmpDir = true; boot.cleanTmpDir = true;
@ -24,7 +25,6 @@ in
defaults.email = "dmitriy@pleshevski.ru"; defaults.email = "dmitriy@pleshevski.ru";
}; };
# See: https://nixos-mailserver.readthedocs.io/en/latest/options.html # See: https://nixos-mailserver.readthedocs.io/en/latest/options.html
mailserver = { mailserver = {
enable = true; enable = true;
@ -37,4 +37,33 @@ in
hierarchySeparator = "/"; hierarchySeparator = "/";
}; };
services.postgresql = {
enable = true;
package = pkgs.postgresql_14;
};
services.gitea = {
enable = true;
httpPort = 9901;
domain = "nix-git.pleshevski.ru";
rootUrl = "https://nix-git.pleshevski.ru";
database = {
type = "postgres";
host = "/run/postgresql";
port = config.services.postgresql.port;
};
settings = {
log.LEVEL = "Error";
service.DISABLE_REGISTRATION = true;
metrics.ENABLED = true;
server.DISABLE_ROUTER_LOG = true;
};
};
services.nginx.virtualHosts."nix-git.pleshevski.ru" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:${toString config.services.gitea.httpPort}/";
};
} }

View file

@ -0,0 +1,11 @@
{
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
}