mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/wstunnel: improve assertions
nixos/wstunnel: run nixfmt on module file
This commit is contained in:
parent
3f4d074319
commit
16570980b6
1 changed files with 5 additions and 4 deletions
|
@ -168,7 +168,7 @@ let
|
|||
};
|
||||
|
||||
localToRemote = lib.mkOption {
|
||||
description = ''Listen on local and forwards traffic from remote.'';
|
||||
description = "Listen on local and forwards traffic from remote.";
|
||||
type = lib.types.listOf (lib.types.str);
|
||||
default = [ ];
|
||||
example = [
|
||||
|
@ -468,10 +468,11 @@ in
|
|||
|
||||
(lib.mapAttrsToList (name: serverCfg: {
|
||||
assertion =
|
||||
(serverCfg.tlsCertificate == null && serverCfg.tlsKey == null)
|
||||
|| (serverCfg.tlsCertificate != null && serverCfg.tlsKey != null);
|
||||
serverCfg.enableHTTPS
|
||||
->
|
||||
(serverCfg.useACMEHost != null) || (serverCfg.tlsCertificate != null && serverCfg.tlsKey != null);
|
||||
message = ''
|
||||
services.wstunnel.servers."${name}".tlsCertificate and services.wstunnel.servers."${name}".tlsKey need to be set together.
|
||||
If services.wstunnel.servers."${name}".enableHTTPS is set to true, either services.wstunnel.servers."${name}".useACMEHost or both services.wstunnel.servers."${name}".tlsKey and services.wstunnel.servers."${name}".tlsCertificate need to be set.
|
||||
'';
|
||||
}) cfg.servers)
|
||||
++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue