add nginx

This commit is contained in:
Zynh Ludwig 2024-12-27 05:42:42 -08:00
parent 3cf5fa031a
commit 7f6594fce5
2 changed files with 22 additions and 1 deletions

17
modules/nginx.nix Normal file
View file

@ -0,0 +1,17 @@
{ lib, config, ... }:
let
cfg = config.permafrost.nginx;
in
{
options.permafrost.nginx = {
enable = lib.mkEnableOption "nginx nixos module";
};
config = lib.mkIf cfg.enable {
services.nginx.enable = true;
security.acme.acceptTerms = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
};
}

View file

@ -21,6 +21,10 @@ in
wants = [ "network.target" ];
};
networking.firewall.allowedTCPPorts = [ 3000 ];
permafrost.nginx.enable = lib.mkDefault true;
services.nginx.virtualHosts."nyazoom.zynh.me" = {
serverName = "nyazoom.zynh.me";
locations."/".proxyPass = "http://localhost:3000";
};
};
}