diff --git a/config/shared.nix b/config/shared.nix index c28b8e7..29c0104 100644 --- a/config/shared.nix +++ b/config/shared.nix @@ -1,8 +1,8 @@ -{ config, pkgs, hostName, ... }: +{ config, pkgs, domain, ... }: { # Set hostname (passed as parameter) - networking.hostName = hostName; + networking.hostName = domain; # System packages environment.systemPackages = with pkgs; [ @@ -17,10 +17,28 @@ # Enable and configure nginx services.nginx = { enable = true; - virtualHosts."${hostName}" = { + + # Web-app service + virtualHosts."app.${domain}" = { root = "/var/src/web-app-dist"; locations."/" = { index = "index.html"; + tryFiles = "$uri $uri/ /index.html"; + }; + }; + + # LNbits service (example - adjust as needed) + virtualHosts."lnbits.${domain}" = { + locations."/" = { + proxyPass = "http://localhost:5000"; + proxyWebsockets = true; + }; + }; + + # Image service (example - adjust as needed) + virtualHosts."img.${domain}" = { + locations."/" = { + proxyPass = "http://localhost:8080"; }; }; };