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

networking/bonds: fix examples

After the change of the bonding options, the examples were not quite correct.
The diff is over-the top because the new `let` needs everything indented.

Also add a small docstring to the `networkd` attr in the networking test.
This commit is contained in:
Profpatsch 2017-03-06 13:23:45 +01:00
parent ebeb722e14
commit 22c265182f
2 changed files with 94 additions and 91 deletions

View file

@ -560,15 +560,20 @@ in
};
networking.bonds = mkOption {
networking.bonds =
let
driverOptionsExample = {
miimon = "100";
mode = "active-backup";
};
in mkOption {
default = { };
example = literalExample {
bond0 = {
interfaces = [ "eth0" "wlan0" ];
miimon = 100;
mode = "active-backup";
driverOptions = driverOptionsExample;
};
fatpipe.interfaces = [ "enp4s0f0" "enp4s0f1" "enp5s0f0" "enp5s0f1" ];
anotherBond.interfaces = [ "enp4s0f0" "enp4s0f1" "enp5s0f0" "enp5s0f1" ];
};
description = ''
This option allows you to define bond devices that aggregate multiple,
@ -590,11 +595,7 @@ in
driverOptions = mkOption {
type = types.attrsOf types.str;
default = {};
example = literalExample {
interfaces = [ "eth0" "wlan0" ];
miimon = 100;
mode = "active-backup";
};
example = literalExample driverOptionsExample;
description = ''
Options for the bonding driver.
Documentation can be found in

View file

@ -1,4 +1,6 @@
{ system ? builtins.currentSystem, networkd }:
{ system ? builtins.currentSystem
# bool: whether to use networkd in the tests
, networkd }:
with import ../lib/testing.nix { inherit system; };
with pkgs.lib;