diff --git a/modules/nginx.nix b/modules/nginx.nix new file mode 100644 index 0000000..3e9b22e --- /dev/null +++ b/modules/nginx.nix @@ -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 ]; + }; +} diff --git a/modules/nyazoom.nix b/modules/nyazoom.nix index 12a7ebd..2fa8176 100644 --- a/modules/nyazoom.nix +++ b/modules/nyazoom.nix @@ -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"; + }; }; }