From 310699319b422210b70ebacf676007172c67c90b Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 15 Sep 2020 20:42:34 +0200 Subject: [PATCH] nixos/doc: Add docs for types.anything --- nixos/doc/manual/development/option-types.xml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml index 9827615349d..3d2191e2f3f 100644 --- a/nixos/doc/manual/development/option-types.xml +++ b/nixos/doc/manual/development/option-types.xml @@ -54,6 +54,46 @@ + + + types.anything + + + + A type that accepts any value and recursively merges attribute sets together. + This type is recommended when the option type is unknown. + + <literal>types.anything</literal> Example + + Two definitions of this type like + +{ + str = lib.mkDefault "foo"; + pkg.hello = pkgs.hello; + fun.fun = x: x + 1; +} + + +{ + str = lib.mkIf true "bar"; + pkg.gcc = pkgs.gcc; + fun.fun = lib.mkForce (x: x + 2); +} + + will get merged to + +{ + str = "bar"; + pkg.gcc = pkgs.gcc; + pkg.hello = pkgs.hello; + fun.fun = x: x + 2; +} + + + + + + types.attrs