diff --git a/nixos/modules/services/web-servers/h2o/default.nix b/nixos/modules/services/web-servers/h2o/default.nix index f752b6b9b256..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; }; }; }; @@ -302,6 +305,22 @@ in type = settingsFormat.type; default = { }; description = "Configuration for H2O (see )"; + example = + literalExpression + # nix + '' + { + compress = "ON"; + ssl-offload = "kernel"; + http2-reprioritize-blocking-assets = "ON"; + "file.mime.addtypes" = { + "text/x-rst" = { + extensions = [ ".rst" ]; + is_compressible = "YES"; + }; + }; + } + ''; }; hosts = mkOption { diff --git a/nixos/modules/services/web-servers/h2o/vhost-options.nix b/nixos/modules/services/web-servers/h2o/vhost-options.nix index 907551113826..9c8a74a62bb1 100644 --- a/nixos/modules/services/web-servers/h2o/vhost-options.nix +++ b/nixos/modules/services/web-servers/h2o/vhost-options.nix @@ -33,7 +33,18 @@ in "example.org" ]; description = '' - Additional names of virtual hosts served by this virtual host configuration. + Additional names of virtual hosts served by this virtual host + configuration. + ''; + }; + + host = mkOption { + type = types.nullOr types.nonEmptyStr; + default = null; + example = "127.0.0.1"; + description = '' + Set the host address for this virtual host. If unset, the default is to + listen on all network interfaces. ''; }; @@ -70,7 +81,7 @@ in config.services.h2o.defaultTLSListenPort ''; description = '' - Override the default TLS port for this virtual host."; + Override the default TLS port for this virtual host. ''; example = 8443; }; @@ -105,11 +116,17 @@ in options = { key-file = mkOption { type = types.path; - description = "Path to key file"; + description = '' + Path to key file. See + . + ''; }; certificate-file = mkOption { type = types.path; - description = "Path to certificate file"; + description = '' + Path to certificate file. See + . + ''; }; }; } @@ -139,7 +156,8 @@ in type = types.attrs; default = { }; description = '' - Additional TLS/SSL-related configuration options. + Additional TLS/SSL-related configuration options. See + . ''; example = literalExpression @@ -205,7 +223,8 @@ in default = { }; description = '' Attrset to be transformed into YAML for host config. Note that the HTTP - / TLS configurations will override these config values. + / TLS configurations will override these config values. See + . ''; }; };