Netconf-Module/auto-doc.md
2024-09-04 09:17:07 +02:00

9.9 KiB
Raw Blame History

_module.args

Additional arguments passed to each module in addition to ones like lib, config, and pkgs, modulesPath.

This option is also available to all submodules. Submodules do not inherit args from their parent module, nor do they provide args to their parent module or sibling submodules. The sole exception to this is the argument name which is provided by parent modules to a submodule and contains the attribute name the submodule is bound to, or a unique generated name if it is not bound to an attribute.

Some arguments are already passed by default, of which the following cannot be changed with this option:

  • lib: The nixpkgs library.

  • config: The results of all options after merging the values from all modules together.

  • options: The options declared in all modules.

  • specialArgs: The specialArgs argument passed to evalModules.

  • All attributes of specialArgs

    Whereas option values can generally depend on other option values thanks to laziness, this does not apply to imports, which must be computed statically before anything else.

    For this reason, callers of the module system can provide specialArgs which are available during import resolution.

    For NixOS, specialArgs includes modulesPath, which allows you to import extra modules from the nixpkgs package tree without having to somehow make the module aware of the location of the nixpkgs or NixOS directories.

    { modulesPath, ... }: {
      imports = [
        (modulesPath + "/profiles/minimal.nix")
      ];
    }
    

For NixOS, the default value for this option includes at least this argument:

  • pkgs: The nixpkgs package set according to the nixpkgs.pkgs option.

Type: lazy attribute set of raw value

Declared by:

dgn-interfaces

Unified configuration of interfaces adapted to DGNum usage:

  • each interfaces have only one logical subinterface;
  • enabling ethernet-switching also enable RSTP;
  • automatic enabling interface and relevant config family when configuring;
  • allows enabling PoE along other configurations.

Type: attribute set of (submodule)

Default: { }

Declared by:

dgn-interfaces.<name>.enable

Whether to enable this interface.

Type: boolean

Default: "config.inet.enable || config.inet6.enable || config.ethernet-switching.enable"

Example: true

Declared by:

dgn-interfaces.<name>.ethernet-switching.enable

Whether to enable the ethernet switching on this interface.

Type: boolean

Default: "config.ethernet-switching.interface-mode != null"

Example: true

Declared by:

dgn-interfaces.<name>.ethernet-switching.interface-mode

Mode of operation for vlan addressing of this interface. “trunk” means that the traffic is tagged, “access” means the traffic is tagged by the switch. Use null to desactivate the switching.

Type: null or one of “trunk”, “access”

Default: null

Declared by:

dgn-interfaces.<name>.ethernet-switching.vlans

Vlans that can be used on this interface. Only one ID should be here for “access” mode of operation.

Type: list of (string or (unsigned integer, meaning >=0))

Default: [ ]

Declared by:

dgn-interfaces.<name>.inet.enable

Whether to enable the ipv4 on this interface.

Type: boolean

Default: "config.inet.addresses != [ ]"

Example: true

Declared by:

dgn-interfaces.<name>.inet.addresses

ipv4 addresses of this interface.

Type: list of string

Default: [ ]

Declared by:

dgn-interfaces.<name>.inet6.enable

Whether to enable the ipv6 on this interface.

Type: boolean

Default: "config.inet6.addresses != [ ]"

Example: true

Declared by:

dgn-interfaces.<name>.inet6.addresses

ipv6 addresses of this interface.

Type: list of string

Default: [ ]

Declared by:

dgn-interfaces.<name>.poe

Whether to enable the PoE on this interface.

Type: boolean

Default: false

Example: true

Declared by:

interfaces

The interfaces configuration.

Type: attribute set of (submodule)

Declared by:

interfaces.<name>.enable

Whether to enable this physical interface.

Type: boolean

Default: false

Example: true

Declared by:

interfaces.<name>.unit

Configuration of the logical interfaces on this physical interface.

Type: attribute set of (submodule)

Default: { }

Declared by:

interfaces.<name>.unit.<name>.enable

Whether to enable this logical interface.

Type: boolean

Default: true

Example: false

Declared by:

interfaces.<name>.unit.<name>.family.ethernet-switching.enable

Whether to enable the ethernet switching on this logical interface.

Type: boolean

Default: false

Example: true

Declared by:

interfaces.<name>.unit.<name>.family.ethernet-switching.interface-mode

Mode of operation for vlan addressing of this interface. “trunk” means that the traffic is tagged, “access” means the traffic is tagged by the switch.

Type: one of “trunk”, “access”

Declared by:

interfaces.<name>.unit.<name>.family.ethernet-switching.vlans

Vlans that can be used on this interface. Only one ID should be here for “access” mode of operation.

Type: list of (string or (unsigned integer, meaning >=0))

Default: [ ]

Declared by:

interfaces.<name>.unit.<name>.family.inet.enable

Whether to enable the IPv4 configuration of this logical interface.

Type: boolean

Default: false

Example: true

Declared by:

interfaces.<name>.unit.<name>.family.inet.addresses

ipv4 addresses of this interface.

Type: list of string

Default: [ ]

Declared by:

interfaces.<name>.unit.<name>.family.inet6.enable

Whether to enable the IPv6 configuration of this logical interface.

Type: boolean

Default: false

Example: true

Declared by:

interfaces.<name>.unit.<name>.family.inet6.addresses

ipv6 addresses of this interface.

Type: list of string

Default: [ ]

Declared by:

netconf.mandatoryInterfaces

JunOS require some interfaces to always be configured (even if they are disabled), which correspond to physical interfaces of the switch. They have to be declared here with some information about it (only if it supports PoE for now).

Type: attribute set of (submodule)

Example:

{
  "ge-0/0/0" = {
    supportPoE = true;
  };
  "ge-0/0/1" = {
    supportPoE = true;
  };
  "xe-0/0/0" = {
    supportPoE = false;
  };
}

Declared by:

netconf.mandatoryInterfaces.<name>.supportPoE

Wether this interface supports PoE.

Type: boolean

Example: true

Declared by:

netconf.xmls.configuration

The full configuration to send to a JunOS.

Type: string (read only)

Declared by:

poe.interfaces

PoE configuration of interfaces.

Type: attribute set of (submodule)

Default: { }

Declared by:

poe.interfaces.<name>.enable

Whether to enable the PoE for this interface.

Type: boolean

Default: false

Example: true

Declared by:

protocols.rstp

List of interfaces on which Rapid Spanning Tree Protocol should be enabled.

Type: list of string

Declared by:

vlans

Named vlans configuration. Allows to name vlans inside interface configuration, instead of just using their IDs.

Type: attribute set of (submodule)

Declared by:

vlans.<name>.id

The ID of this vlan, null means no ID. Incompatible with vlans.name.id-list.

Type: null or (unsigned integer, meaning >=0)

Default: null

Declared by:

vlans.<name>.id-list

List of IDs or IDs range to classify as this vlan. Incompatible with vlans.name.id.

Type: list of (unsigned integer, meaning >=0, or (submodule))

Default: [ ]

Example:

[
  42
  {
    begin = 100;
    end = 200;
  }
]

Declared by:

vlans.<name>.l3-interface

Switchs logical interface to connect directly to this vlan. This allows to communicate with the switch from a vlan without having a cable looping back on its management interface.

Type: null or string

Default: null

Example: "irb.0"

Declared by: