2024-09-09 15:19:57 +02:00
|
|
|
{
|
2025-01-23 14:13:19 +01:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.services.vm_gitea;
|
|
|
|
in {
|
2024-09-09 15:19:57 +02:00
|
|
|
options.services.vm_gitea = {
|
|
|
|
enable = lib.mkEnableOption "Enable minimal config";
|
|
|
|
db_ip = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Gitea database IP address";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.gitea = {
|
|
|
|
enable = true;
|
|
|
|
user = "tbarnouin";
|
|
|
|
settings = {
|
|
|
|
server.HTTP_PORT = 3000;
|
|
|
|
server.ROOT_URL = "http://${config.services.vm.vm_ip}/";
|
|
|
|
service.DISABLE_REGISTRATION = true;
|
|
|
|
};
|
|
|
|
database = {
|
|
|
|
createDatabase = false;
|
|
|
|
type = "postgres";
|
|
|
|
host = "${cfg.db_ip}";
|
|
|
|
user = "gitea";
|
|
|
|
passwordFile = "/run/secrets/gitea/gitea-dbpass";
|
|
|
|
};
|
|
|
|
};
|
2025-01-23 14:13:19 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [3000];
|
2024-09-09 15:19:57 +02:00
|
|
|
};
|
|
|
|
}
|