nixos-hypervisor/services/forgejo/default.nix

38 lines
877 B
Nix
Raw Normal View History

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