summaryrefslogtreecommitdiffstats
path: root/nixos/modules/tasks/network-interfaces.nix
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2018-01-31 05:51:09 +0100
committerrnhmjoj <rnhmjoj@inventati.org>2018-01-31 05:51:09 +0100
commit46c158a32f1b920fe0280c7aea3f42670ece7473 (patch)
tree9c20825e60c1b14666b73325b0627f0418eb3aa5 /nixos/modules/tasks/network-interfaces.nix
parentdc52fc6dda00c4f3e275e56a5f4f0386260e4063 (diff)
nixos/networking-interfaces: set default value for virtualType
Diffstat (limited to 'nixos/modules/tasks/network-interfaces.nix')
-rw-r--r--nixos/modules/tasks/network-interfaces.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index b7e85e402aa9..2a17ae934f8a 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -273,11 +273,13 @@ let
};
virtualType = mkOption {
- default = null;
- type = with types; nullOr (enum [ "tun" "tap" ]);
+ default = if hasPrefix "tun" name then "tun" else "tap";
+ defaultText = ''if hasPrefix "tun" name then "tun" else "tap"'';
+ type = with types; enum [ "tun" "tap" ];
description = ''
- The explicit type of interface to create. Accepts tun or tap strings.
- Also accepts null to implicitly detect the type of device.
+ The type of interface to create.
+ The default is TUN for an interface name starting
+ with "tun", otherwise TAP.
'';
};