mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 04:49:01 +02:00
wireguard service: allow empty interfaces (#61743)
wireguard service: allow empty interfaces
This commit is contained in:
commit
e4de353830
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue