1{ lib, ... }:
2{
3 options = {
4 server = lib.mkOption {
5 type = lib.types.either (lib.types.submodule (import ./server-options.nix)) (lib.types.path);
6 example = {
7 host = "127.0.0.1";
8 port = 8888;
9 };
10 default = {
11 host = "127.0.0.1";
12 port = 80;
13 };
14 description = ''
15 Backend server location specified as either a host:port pair
16 or a unix domain docket.
17 '';
18 };
19
20 patterns = lib.mkOption {
21 type = lib.types.listOf lib.types.str;
22 example = [
23 "*.host.net/v1/"
24 "host.org/v2/mypath"
25 "/somepath"
26 ];
27 default = [ ];
28 description = ''
29 List of nghttpx backend patterns.
30
31 Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b
32 for more information on the pattern syntax and nghttpxs behavior.
33 '';
34 };
35
36 params = lib.mkOption {
37 type = lib.types.nullOr (lib.types.submodule (import ./backend-params-submodule.nix));
38 example = {
39 proto = "h2";
40 tls = true;
41 };
42 default = null;
43 description = ''
44 Parameters to configure a backend.
45 '';
46 };
47 };
48}