dotfiles/nix/modules/nixos/features/homelab/gitea.nix

37 lines
667 B
Nix
Raw Normal View History

2024-11-26 08:40:00 +00:00
{ config, lib, ... }:
2024-12-10 21:40:33 +00:00
with lib;
let
port = 2222;
in
2024-11-26 08:40:00 +00:00
{
2024-12-10 21:40:33 +00:00
options.features.homelab.gitea.enable = mkEnableOption "Enable gitea";
2024-11-26 08:40:00 +00:00
2024-12-10 21:40:33 +00:00
config = mkIf config.features.homelab.gitea.enable {
services = {
gitea = {
enable = true;
group = "media";
stateDir = "/mnt/media/gitea";
2024-11-26 08:40:00 +00:00
settings = {
server = {
HTTP_PORT = port;
};
2024-11-26 08:40:00 +00:00
service = {
DISABLE_REGISTRATION = true;
};
2024-11-26 08:40:00 +00:00
};
};
caddy.virtualHosts."gitea.opdavies.uk" = {
useACMEHost = "opdavies.uk";
extraConfig = "reverse_proxy localhost:${toString port}";
};
2024-11-26 08:40:00 +00:00
};
};
}