2024-12-19 18:00:00 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
port = 2223;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.features.homelab.forgejo.enable = mkEnableOption "Enable forgejo";
|
|
|
|
|
|
|
|
config = mkIf config.features.homelab.forgejo.enable {
|
|
|
|
services = {
|
|
|
|
forgejo = {
|
|
|
|
enable = true;
|
|
|
|
group = "media";
|
|
|
|
stateDir = "/mnt/media/forgejo";
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
HTTP_PORT = port;
|
|
|
|
};
|
|
|
|
|
|
|
|
service = {
|
|
|
|
DISABLE_REGISTRATION = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nginx = {
|
|
|
|
enable = true;
|
|
|
|
|
2024-12-26 21:35:05 +00:00
|
|
|
virtualHosts."forgejo.oliverdavies.uk".locations."/".proxyPass =
|
|
|
|
"http://localhost:${toString port}/";
|
2024-12-19 18:00:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|