summaryrefslogtreecommitdiff
path: root/Biz/Nixpert.nix
blob: faf27b27b16cf2c39c059778c49264578bbda377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ pkgs, ... }:

let
  salespage = pkgs.runCommand "salespage" {} ''
    mkdir -p $out
    ${pkgs.pandoc}/bin/pandoc \
      --standalone \
      -f commonmark_x \
      --include-in-header ${./Que/Style.css} \
      --include-in-header ${./Nixpert/ChatWidget.html} \
      -t html \
      ${./Nixpert.md} \
      > $out/index.html
  '';
in {
  services.nginx.virtualHosts."nixpert.chat" = {
    forceSSL = true;
    enableACME = true;
    locations."/" = {
      root = "${salespage}";
      extraConfig = ''
        add_header Access-Control-Allow-Origin "*";
      '';
    };
  };
}