wireguard service: allow empty interfaces (#61743)

wireguard service: allow empty interfaces
This commit is contained in:
Florian Klink
2019-05-25 16:30:27 +02:00
committed by GitHub

View File

@@ -301,8 +301,16 @@ in
networking.wireguard = {
enable = mkOption {
description = "Whether to enable WireGuard.";
type = types.bool;
# 2019-05-25: Backwards compatibility.
default = cfg.interfaces != {};
example = true;
};
interfaces = mkOption {
description = "Wireguard interfaces.";
description = "WireGuard interfaces.";
default = {};
example = {
wg0 = {
@@ -325,7 +333,7 @@ in
###### implementation
config = mkIf (cfg.interfaces != {}) {
config = mkIf cfg.enable {
assertions = (attrValues (
mapAttrs (name: value: {