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
commit e4de353830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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