puzzlevision/modules/nixos/services/forgejo/default.nix
Jo 84bfdec3f2 feat(modules/nixos): W.I.P add forgejo service
feat(modules/nixos): add admin module for system wide admin data
2024-12-27 20:37:00 +01:00

56 lines
1.1 KiB
Nix

{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.services.forgejo;
in
{
options.${namespace}.services.forgejo = {
enable = mkEnableOption "Whether to enable the forgejo git service.";
};
config = mkIf cfg.enable {
services.forgejo = {
enable = true;
database = {
type = "postgres";
};
lfs.enable = true;
settings = {
server = {
DOMAIN = "git.thevoid.cafe";
ROOT_URL = "https://git.thevoid.cafe/";
HTTP_PORT = "3030";
};
service.DISABLE_REGISTRATION = true;
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "github";
};
};
};
# TODO: finish this configuration
services.traefik = {
dynamicConfigOptions = {
http = {
routers.forgejo = {
entryPoints = ["websecure"];
rule = "Host(`git.thevoid.cafe`)";
service = "forgejo";
};
services.forgejo.loadbalancer.server = {
url = "http://localhost:3030";
};
};
};
};
};
}