add gitea

This commit is contained in:
Cyryl Płotnicki 2022-10-25 21:23:22 +01:00
parent 240fad9ff2
commit cb2d12ac14
2 changed files with 60 additions and 0 deletions

View file

@ -10,6 +10,7 @@
./cryptpad.nix
./fossil.nix
./foundryvtt.nix
./gitea.nix
./matrix-front.nix
./rss.nix
./search.nix

View file

@ -0,0 +1,59 @@
{ config, pkgs, inputs, lib, ... }:
let
httpPort = 8083;
sshPort = 2222;
domain = "git.cyplo.dev";
baseurl = "https://${domain}";
path = "/var/lib/gitea";
in {
imports = [ ../nginx.nix ];
networking.firewall.allowedTCPPorts = [ sshPort ];
services.nginx = {
virtualHosts = {
"${domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:" + toString httpPort;
};
};
};
};
containers.gitea = {
autoStart = true;
forwardPorts = [
{
containerPort = httpPort;
hostPort = httpPort;
}
{
containerPort = sshPort;
hostPort = sshPort;
}
];
bindMounts = {
"${path}" = {
hostPath = "${path}";
isReadOnly = false;
};
};
config = { config, pkgs, ... }: {
system.stateVersion = "22.05";
services.gitea = {
enable = true;
domain = domain;
rootUrl = baseurl;
httpPort = httpPort;
disableRegistration = true;
stateDir = path;
ssh = {
enable = true;
clonePort = sshPort;
};
settings = { server = { START_SSH_SERVER = true; }; };
};
};
};
}