{ appConfig, lib, ... }: lib.mkMerge [ { services.nginx.enable = true; services.nginx.virtualHosts.${appConfig.domain}.locations."/".root = appConfig.root; } (lib.mkIf (appConfig.cors != null) { services.nginx.virtualHosts.${appConfig.domain}.locations."/".extraConfig = '' add_header 'Access-Control-Allow-Origin' '${appConfig.cors}'; ''; }) ]