mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00: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:
parent
ebeb722e14
commit
22c265182f
2 changed files with 94 additions and 91 deletions
|
@ -560,15 +560,20 @@ in
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.bonds = mkOption {
|
networking.bonds =
|
||||||
|
let
|
||||||
|
driverOptionsExample = {
|
||||||
|
miimon = "100";
|
||||||
|
mode = "active-backup";
|
||||||
|
};
|
||||||
|
in mkOption {
|
||||||
default = { };
|
default = { };
|
||||||
example = literalExample {
|
example = literalExample {
|
||||||
bond0 = {
|
bond0 = {
|
||||||
interfaces = [ "eth0" "wlan0" ];
|
interfaces = [ "eth0" "wlan0" ];
|
||||||
miimon = 100;
|
driverOptions = driverOptionsExample;
|
||||||
mode = "active-backup";
|
|
||||||
};
|
};
|
||||||
fatpipe.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,
|
||||||
|
@ -590,11 +595,7 @@ in
|
||||||
driverOptions = mkOption {
|
driverOptions = mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
default = {};
|
default = {};
|
||||||
example = literalExample {
|
example = literalExample driverOptionsExample;
|
||||||
interfaces = [ "eth0" "wlan0" ];
|
|
||||||
miimon = 100;
|
|
||||||
mode = "active-backup";
|
|
||||||
};
|
|
||||||
description = ''
|
description = ''
|
||||||
Options for the bonding driver.
|
Options for the bonding driver.
|
||||||
Documentation can be found in
|
Documentation can be found in
|
||||||
|
|
|
@ -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 import ../lib/testing.nix { inherit system; };
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue