From 60f2c59471b29dc45803a02071a965cdea06a5b1 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 29 Nov 2019 12:50:51 +0100 Subject: [PATCH] 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] https://github.com/NixOS/nixpkgs/blob/9db75ed88fd87e17ec448ad7a43b62acb4842854/nixos/modules/system/boot/networkd.nix#L933-L937 --- nixos/modules/system/boot/networkd.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 226769f1059..71668fdfccc 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -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); };