From 9c35f44999b38f07b674ff25cde17452ab4a1969 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 25 Jul 2023 01:53:30 +0200 Subject: lib/modules: handle typeless options in mergeModules mkOption does not require a `type` argument and does not set the resulting attribute if it is not given. Consequently, we need to be prepared to merge options that have no type information. --- lib/tests/modules/merge-typeless-option.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/tests/modules/merge-typeless-option.nix (limited to 'lib/tests/modules') diff --git a/lib/tests/modules/merge-typeless-option.nix b/lib/tests/modules/merge-typeless-option.nix new file mode 100644 index 00000000000..627d90b15db --- /dev/null +++ b/lib/tests/modules/merge-typeless-option.nix @@ -0,0 +1,25 @@ +{ lib, ... }: + +let + typeless = + { lib, ... }: + + { + options.group = lib.mkOption { }; + }; + childOfTypeless = + { lib, ... }: + + { + options.group.enable = lib.mkEnableOption "nothing"; + }; +in + +{ + imports = [ + typeless + childOfTypeless + ]; + + config.group.enable = false; +} -- cgit 1.4.1