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 = {
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: {