Change gitea for forgejo

This commit is contained in:
Théo Barnouin 2025-01-29 10:14:33 +01:00
parent 8d685c6953
commit dbdb2036bf
5 changed files with 39 additions and 23 deletions

View file

@ -0,0 +1,37 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.services.vm_forgejo;
in {
options.services.vm_forgejo = {
enable = lib.mkEnableOption "Enable minimal config";
db_ip = lib.mkOption {
type = lib.types.str;
description = "forgejo database IP address";
};
};
config = lib.mkIf cfg.enable {
services.forgejo = {
enable = true;
user = "tbarnouin";
settings = {
server.HTTP_PORT = 3000;
server.DISABLE_SSH = true;
server.ROOT_URL = "https://git.le43.eu";
service.DISABLE_REGISTRATION = true;
};
database = {
createDatabase = false;
type = "postgres";
host = "${cfg.db_ip}";
name = "gitea";
user = "gitea";
passwordFile = "/run/secrets/forgejo/forgejo-dbpass";
};
};
networking.firewall.allowedTCPPorts = [3000];
};
}