git.iko.soy/typeable/nixpkgs
on master help sign in
network-interfaces module: use enum
commitffc0e2f4fc63f3a2d028dbd7d981223fb19cbeb4 authorEric Sagnes <eric.sagnes@gmail.com> dateFri 4 Nov 2016, 13:05 (10 years ago) parent80b8547
1 file changed+1−1
nixos/modules/tasks/network-interfaces.nix+1−1
nixos/modules/tasks/network-interfaces.nix+1−1
@@ -245,7 +245,7 @@ let
245245
246246 virtualType = mkOption {
247247 default = null;
248− type = types.nullOr (types.addCheck types.str (v: v == "tun" || v == "tap"));
248+ type = with types; nullOr (enum [ "tun" "tap" ]);
249249 description = ''
250250 The explicit type of interface to create. Accepts tun or tap strings.
251251 Also accepts null to implicitly detect the type of device.