From 28aa2901458921a5cfd3eebdce83ee7efae1f3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B9=82=E0=B8=97=E0=B8=AA=E0=B8=BA=E0=B8=95=E0=B8=B1?= =?UTF-8?q?=E0=B8=A5?= Date: Fri, 28 Feb 2025 17:36:20 +0700 Subject: [PATCH] nixos/h2o: add access to listen.host --- nixos/modules/services/web-servers/h2o/default.nix | 3 +++ nixos/modules/services/web-servers/h2o/vhost-options.nix | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/nixos/modules/services/web-servers/h2o/default.nix b/nixos/modules/services/web-servers/h2o/default.nix index a8e419401230..e8441a3a6347 100644 --- a/nixos/modules/services/web-servers/h2o/default.nix +++ b/nixos/modules/services/web-servers/h2o/default.nix @@ -230,6 +230,9 @@ let ssl = (lib.recursiveUpdate tlsRecAttrs value.tls.extraSettings) // { inherit identity; }; + } + // lib.optionalAttrs (value.host != null) { + host = value.host; }; }; }; diff --git a/nixos/modules/services/web-servers/h2o/vhost-options.nix b/nixos/modules/services/web-servers/h2o/vhost-options.nix index 907551113826..4bbca40974bf 100644 --- a/nixos/modules/services/web-servers/h2o/vhost-options.nix +++ b/nixos/modules/services/web-servers/h2o/vhost-options.nix @@ -37,6 +37,15 @@ in ''; }; + host = mkOption { + type = types.nullOr types.nonEmptyStr; + default = null; + example = "127.0.0.1"; + description = '' + Set the host address for this virtual host. + ''; + }; + http = mkOption { type = types.nullOr ( types.submodule {