diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-05-13 09:09:16 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-05-13 09:09:16 +0200 |
commit | 81a0a8be297a88f338ee0fd90c330cd94b4a55bd (patch) | |
tree | 70abd5a2e585165c0b9909a7df7562ff3a3e5f1e /lib/tests/modules | |
parent | 062bc5e74a8905d5f1b8573155c558a4d56e55d4 (diff) | |
download | nixlib-81a0a8be297a88f338ee0fd90c330cd94b4a55bd.tar nixlib-81a0a8be297a88f338ee0fd90c330cd94b4a55bd.tar.gz nixlib-81a0a8be297a88f338ee0fd90c330cd94b4a55bd.tar.bz2 nixlib-81a0a8be297a88f338ee0fd90c330cd94b4a55bd.tar.lz nixlib-81a0a8be297a88f338ee0fd90c330cd94b4a55bd.tar.xz nixlib-81a0a8be297a88f338ee0fd90c330cd94b4a55bd.tar.zst nixlib-81a0a8be297a88f338ee0fd90c330cd94b4a55bd.zip |
lib/tests/modules: Test functionTo submodule merging too
Diffstat (limited to 'lib/tests/modules')
-rw-r--r-- | lib/tests/modules/functionTo/submodule-options.nix | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/tests/modules/functionTo/submodule-options.nix b/lib/tests/modules/functionTo/submodule-options.nix index 7bf708231504..b884892efd6a 100644 --- a/lib/tests/modules/functionTo/submodule-options.nix +++ b/lib/tests/modules/functionTo/submodule-options.nix @@ -10,7 +10,7 @@ in options = { fun = lib.mkOption { type = types.functionTo (types.submodule { - options.a = lib.mkOption { }; + options.a = lib.mkOption { default = "a"; }; }); }; }; @@ -21,7 +21,7 @@ in options = { fun = lib.mkOption { type = types.functionTo (types.submodule { - options.b = lib.mkOption { }; + options.b = lib.mkOption { default = "b"; }; }); }; }; @@ -32,6 +32,12 @@ in result = lib.mkOption { type = types.str; + default = lib.concatStringsSep " " (lib.attrValues (config.fun (throw "shouldn't use input param"))); + }; + + optionsResult = lib.mkOption + { + type = types.str; default = lib.concatStringsSep " " (lib.concatLists (lib.mapAttrsToList @@ -50,10 +56,6 @@ in config.fun = lib.mkMerge [ - (input: { inherit (input) a; }) - (input: { inherit (input) b; }) - (input: { - b = lib.mkForce input.c; - }) + (input: { b = "bee"; }) ]; } |