aboutsummaryrefslogtreecommitdiffstats
path: root/apps/static-website/module.nix
blob: 32fed09e7c7a4285710d191fad9c98c3b748adf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
{ 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}';
    '';
  })
]