permafrost/modules/forgejo.nix

30 lines
716 B
Nix
Raw Permalink Normal View History

2024-12-27 06:29:02 -08:00
{ lib, config, ... }:
let
2024-12-27 13:42:01 -08:00
cfg = config.permafrost.forgejo;
2024-12-27 22:02:45 -08:00
ACMEEnabled = config.permafrost.acme.enable;
2024-12-27 06:29:02 -08:00
in
{
2024-12-27 13:42:01 -08:00
options.permafrost.forgejo = {
enable = lib.mkEnableOption "forgejo nixos module";
2024-12-27 06:29:02 -08:00
};
config = lib.mkIf cfg.enable {
permafrost.nginx.enable = lib.mkDefault true;
2024-12-27 22:02:45 -08:00
permafrost.acme.certDomains = lib.mkIf ACMEEnabled [ "git.zynh.me" ];
2024-12-27 06:29:02 -08:00
services.nginx.virtualHosts."git.zynh.me" = {
serverName = "git.zynh.me";
2024-12-27 22:02:45 -08:00
forceSSL = lib.mkIf ACMEEnabled true;
2024-12-27 20:14:55 -08:00
useACMEHost = lib.mkIf ACMEEnabled "permafrost";
2024-12-27 06:29:02 -08:00
locations."/" = {
proxyPass = "http://localhost:3032";
};
};
2024-12-27 22:25:43 -08:00
networking.firewall.allowedTCPPorts = [
2221 # SSH port
];
2024-12-27 06:29:02 -08:00
};
}