mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
wireguard service: allow empty interfaces
This is needed in case one wants to use wg-quick on NixOS.
This commit is contained in:
parent
971b731fc1
commit
cfadd988e5
@ -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 New Issue
Block a user