nixos-hypervisor/services/gitea/default.nix
Théo Barnouin 781ce2d5e9
All checks were successful
/ Build Nix targets (push) Successful in 3m36s
Format using alejandra
2025-01-23 14:13:19 +01:00

35 lines
822 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];
};
}