nixos-hypervisor/services/forgejo/default.nix
Théo Barnouin f9b9da6f31
Some checks failed
/ Build Nix targets (push) Failing after 14m3s
Add agenix forgejo config
2025-01-29 10:51:14 +01:00

39 lines
979 B
Nix

{
config,
pkgs,
lib,
...
}: let
cfg = config.services.vm_forgejo;
in {
options.services.vm_forgejo = {
enable = lib.mkEnableOption "Enable minimal config";
pgsql_ip = lib.mkOption {
type = lib.types.str;
description = "forgejo database IP address";
};
};
config = lib.mkIf cfg.enable {
age.secrets.forgejoDBPass.file = ./secrets/forgejoDBPass.age;
services.forgejo = {
enable = true;
package = pkgs.forgejo;
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.pgsql_ip}";
name = "gitea";
user = "gitea";
passwordFile = config.age.secrets.forgejoDBPass.path;
};
};
networking.firewall.allowedTCPPorts = [3000];
};
}