nixos/networkd: mark units option as internal

The options at `systemd.network` (`links`, `netdevs` and `networks`) are
directly mapped to the three different unit types of `systemd-networkd(8)`.

However there's also the option `systemd.network.units` which is
basically used as a container for generated unit-configs that are linked
to `/etc/systemd/networkd`[1].

This should not be exposed to the user as it's unclear whether or not it
should be used directly which can be pretty confusing which is why I decided to
declare this option as internal (including all sub-options as `internal`
doesn't seem to be propagated to submodules).

[1] 9db75ed88f/nixos/modules/system/boot/networkd.nix (L933-L937)
This commit is contained in:
Maximilian Bosch 2019-11-29 12:50:51 +01:00
parent 0ee0489d42
commit 60f2c59471
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -911,9 +911,10 @@ in
systemd.network.units = mkOption {
description = "Definition of networkd units.";
default = {};
internal = true;
type = with types; attrsOf (submodule (
{ name, config, ... }:
{ options = concreteUnitOptions;
{ options = mapAttrs (_: x: x // { internal = true; }) concreteUnitOptions;
config = {
unit = mkDefault (makeUnit name config);
};