summary refs log tree commit diff
path: root/nixos/modules/services/networking/nghttpx/backend-submodule.nix
blob: eb559e926e76bd156daa3c7e351f4ec33c11a394 (plain) (blame)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib, ... }:
{ options = {
    server = lib.mkOption {
      type =
        lib.types.either
          (lib.types.submodule (import ./server-options.nix))
          (lib.types.path);
      example = {
        host = "127.0.0.1";
        port = 8888;
      };
      default = {
        host = "127.0.0.1";
        port = 80;
      };
      description = ''
        Backend server location specified as either a host:port pair
        or a unix domain docket.
      '';
    };

    patterns = lib.mkOption {
      type    = lib.types.listOf lib.types.str;
      example = [
        "*.host.net/v1/"
        "host.org/v2/mypath"
        "/somepath"
      ];
      default     = [];
      description = ''
        List of nghttpx backend patterns.

        Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
        for more information on the pattern syntax and nghttpxs behavior.
      '';
    };

    params = lib.mkOption {
      type    = lib.types.nullOr (lib.types.submodule (import ./backend-params-submodule.nix));
      example = {
        proto = "h2";
        tls   = true;
      };
      default     = null;
      description = ''
        Parameters to configure a backend.
      '';
    };
  };
}