summary refs log tree commit diff
path: root/ripple/website/serve.nix
blob: f820cefa78348354c719b3703dddd59d0e418b7a (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
27
28
# SPDX-FileCopyrightText: V <v@unfathomable.blue>
# SPDX-License-Identifier: LicenseRef-NONE

let
  pkgs = import <nixpkgs> {};
  config = builtins.toFile "Caddyfile" ''
    {
      admin off
    }

    :8080

    try_files {path}.html {path}
    file_server {
      root result
    }

    handle_errors {
      respond "{http.error.status_code} {http.error.status_text}"
    }

    log {
      format single_field common_log
    }
  '';
in pkgs.mkShell {
  shellHook = "exec ${pkgs.caddy}/bin/caddy run --adapter caddyfile --config ${config}";
}