33 lines
816 B
Nix
33 lines
816 B
Nix
|
{ config, pkgs, lib, ... }:
|
||
|
let
|
||
|
cfg = config.services.vm_gitea;
|
||
|
in
|
||
|
{
|
||
|
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";
|
||
|
};
|
||
|
};
|
||
|
networking.firewall.allowedTCPPorts = [ 3000 ];
|
||
|
};
|
||
|
}
|