mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 17:23:34 +00: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 = {
|
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: {
|
||||||
|
Loading…
Reference in New Issue
Block a user