summary refs log tree commit diff
path: root/nixos/modules/services/networking/nghttpx/backend-submodule.nix
diff options
context:
space:
mode:
authorParnell Springmeyer <ixmatus@users.noreply.github.com>2017-11-16 12:21:02 -0600
committerJörg Thalheim <Mic92@users.noreply.github.com>2017-11-16 18:21:02 +0000
commitcb11bf73a511819ee36c4bddb97573aacda0b161 (patch)
treef4256571834c529fb6fa204f3163a7b965302574 /nixos/modules/services/networking/nghttpx/backend-submodule.nix
parent8bd10a17c6c811b423126af1d3dc37aa82a7c131 (diff)
downloadnixpkgs-cb11bf73a511819ee36c4bddb97573aacda0b161.tar
nixpkgs-cb11bf73a511819ee36c4bddb97573aacda0b161.tar.gz
nixpkgs-cb11bf73a511819ee36c4bddb97573aacda0b161.tar.bz2
nixpkgs-cb11bf73a511819ee36c4bddb97573aacda0b161.tar.lz
nixpkgs-cb11bf73a511819ee36c4bddb97573aacda0b161.tar.xz
nixpkgs-cb11bf73a511819ee36c4bddb97573aacda0b161.tar.zst
nixpkgs-cb11bf73a511819ee36c4bddb97573aacda0b161.zip
nixos/nghttpx: add module for the nghttpx proxy server (#31680)
* nghttpx: Add a new NixOS module for the nghttpx proxy server

This change also adds a global `uid` and `gid` for a `nghttpx` user
and group as well as an integration test.

* nixos/nghttpx: fix building manual
Diffstat (limited to 'nixos/modules/services/networking/nghttpx/backend-submodule.nix')
-rw-r--r--nixos/modules/services/networking/nghttpx/backend-submodule.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/nghttpx/backend-submodule.nix b/nixos/modules/services/networking/nghttpx/backend-submodule.nix
new file mode 100644
index 00000000000..eb559e926e7
--- /dev/null
+++ b/nixos/modules/services/networking/nghttpx/backend-submodule.nix
@@ -0,0 +1,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.
+      '';
+    };
+  };
+}