nixos-server/services/gitea.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

2024-05-25 15:12:56 +02:00
{ pkgs, lib, ... }:
{
2024-05-24 11:13:36 +02:00
name = "gitea";
config = {
services.gitea = {
enable = true;
appName = "My awesome Gitea server"; # Give the site a name
2024-05-25 15:12:56 +02:00
user = "git";
2024-05-24 11:13:36 +02:00
database = {
2024-05-24 22:30:04 +02:00
type = "postgres";
host = "postgres.containers";
2024-05-31 10:36:14 +02:00
port = 5432;
2024-05-24 22:30:04 +02:00
name = "gitea";
user = "gitea";
createDatabase = false;
2024-05-24 22:30:04 +02:00
passwordFile = ../secrets/gitea_postgres_pass;
2024-05-24 11:13:36 +02:00
};
settings.server = {
DOMAIN = "localhost";
ROOT_URL = "http://localhost/";
HTTP_PORT = 3001;
};
2024-05-30 21:57:23 +02:00
settings.actions = {
ENABLED = true;
};
2024-05-24 11:13:36 +02:00
};
2024-05-25 15:12:56 +02:00
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
users.users.git = {
home = "/var/lib/gitea";
group = "git";
shell = pkgs.bashInteractive;
isSystemUser = true;
};
users.groups.git = {};
2024-05-24 11:13:36 +02:00
};
ports = {
2024-05-25 15:12:56 +02:00
tcp = [ 3001 22 ];
2024-05-24 11:13:36 +02:00
udp = [];
http = 3001;
2024-05-25 15:12:56 +02:00
forward = [ { container = 22; host = 22; proto = "tcp"; } ];
2024-05-24 11:13:36 +02:00
};
2024-05-30 21:57:23 +02:00
hosts = [ "githug.xyz" ];
2024-05-25 01:01:07 +02:00
volumes = [{
name = "gitea-statedir";
mountPoint = "/var/lib/gitea";
2024-05-25 15:12:56 +02:00
}];
2024-05-24 11:13:36 +02:00
}