0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

nixos/network-interfaces: fix examples types

make literalExample receive string arguments.
Fix nixos/nixos-homepage#255
This commit is contained in:
David Costa 2020-03-29 00:50:26 +01:00
parent f8ccef5edb
commit 2e4a45c921

View file

@ -634,19 +634,23 @@ in
networking.bonds = networking.bonds =
let let
driverOptionsExample = { driverOptionsExample = ''
miimon = "100"; {
mode = "active-backup"; miimon = "100";
}; mode = "active-backup";
}
'';
in mkOption { in mkOption {
default = { }; default = { };
example = literalExample { example = literalExample ''
bond0 = { {
interfaces = [ "eth0" "wlan0" ]; bond0 = {
driverOptions = driverOptionsExample; interfaces = [ "eth0" "wlan0" ];
}; driverOptions = ${driverOptionsExample};
anotherBond.interfaces = [ "enp4s0f0" "enp4s0f1" "enp5s0f0" "enp5s0f1" ]; };
}; anotherBond.interfaces = [ "enp4s0f0" "enp4s0f1" "enp5s0f0" "enp5s0f1" ];
}
'';
description = '' description = ''
This option allows you to define bond devices that aggregate multiple, This option allows you to define bond devices that aggregate multiple,
underlying networking interfaces together. The value of this option is underlying networking interfaces together. The value of this option is
@ -731,12 +735,14 @@ in
networking.macvlans = mkOption { networking.macvlans = mkOption {
default = { }; default = { };
example = literalExample { example = literalExample ''
wan = { {
interface = "enp2s0"; wan = {
mode = "vepa"; interface = "enp2s0";
}; mode = "vepa";
}; };
}
'';
description = '' description = ''
This option allows you to define macvlan interfaces which should This option allows you to define macvlan interfaces which should
be automatically created. be automatically created.
@ -764,18 +770,20 @@ in
networking.sits = mkOption { networking.sits = mkOption {
default = { }; default = { };
example = literalExample { example = literalExample ''
hurricane = { {
remote = "10.0.0.1"; hurricane = {
local = "10.0.0.22"; remote = "10.0.0.1";
ttl = 255; local = "10.0.0.22";
}; ttl = 255;
msipv6 = { };
remote = "192.168.0.1"; msipv6 = {
dev = "enp3s0"; remote = "192.168.0.1";
ttl = 127; dev = "enp3s0";
}; ttl = 127;
}; };
}
'';
description = '' description = ''
This option allows you to define 6-to-4 interfaces which should be automatically created. This option allows you to define 6-to-4 interfaces which should be automatically created.
''; '';
@ -826,16 +834,18 @@ in
networking.vlans = mkOption { networking.vlans = mkOption {
default = { }; default = { };
example = literalExample { example = literalExample ''
vlan0 = { {
id = 3; vlan0 = {
interface = "enp3s0"; id = 3;
}; interface = "enp3s0";
vlan1 = { };
id = 1; vlan1 = {
interface = "wlan0"; id = 1;
}; interface = "wlan0";
}; };
}
'';
description = description =
'' ''
This option allows you to define vlan devices that tag packets This option allows you to define vlan devices that tag packets
@ -868,24 +878,26 @@ in
networking.wlanInterfaces = mkOption { networking.wlanInterfaces = mkOption {
default = { }; default = { };
example = literalExample { example = literalExample ''
wlan-station0 = { {
device = "wlp6s0"; wlan-station0 = {
}; device = "wlp6s0";
wlan-adhoc0 = { };
type = "ibss"; wlan-adhoc0 = {
device = "wlp6s0"; type = "ibss";
mac = "02:00:00:00:00:01"; device = "wlp6s0";
}; mac = "02:00:00:00:00:01";
wlan-p2p0 = { };
device = "wlp6s0"; wlan-p2p0 = {
mac = "02:00:00:00:00:02"; device = "wlp6s0";
}; mac = "02:00:00:00:00:02";
wlan-ap0 = { };
device = "wlp6s0"; wlan-ap0 = {
mac = "02:00:00:00:00:03"; device = "wlp6s0";
}; mac = "02:00:00:00:00:03";
}; };
}
'';
description = description =
'' ''
Creating multiple WLAN interfaces on top of one physical WLAN device (NIC). Creating multiple WLAN interfaces on top of one physical WLAN device (NIC).