flake/modules/forgejo.nix
2025-03-04 21:39:49 +03:00

39 lines
937 B
Nix

{
lib,
config,
...
}: {
options = {
myModules.enableForgejo = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable Forgejo server";
};
};
config = lib.mkMerge [
(lib.mkIf config.myModules.enableForgejo {
services.forgejo = {
enable = true;
settings = {
server = {
DOMAIN = "git.osbm.dev";
ROOT_URL = "https://git.osbm.dev/";
};
service = {
DISABLE_REGISTRATION = false;
};
};
};
})
# if enableForgejo and enableCaddy are enabled, add forgejo to caddy
(lib.mkIf (config.myModules.enableForgejo && config.myModules.enableCaddy) {
services.caddy.virtualHosts."git.osbm.dev" = {
extraConfig = ''
reverse_proxy pochita.curl-boga.ts.net:3000
# acme_dns cloudflare {env.CF_API_TOKEN}
'';
};
})
];
}