From c2f3556dc75ee09890c2cfc867cdb10df23accf6 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 26 Jan 2021 22:30:07 +0100 Subject: lib/tests: More functionTo tests --- lib/tests/modules/functionTo/list-order.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/tests/modules/functionTo/list-order.nix (limited to 'lib/tests/modules/functionTo/list-order.nix') diff --git a/lib/tests/modules/functionTo/list-order.nix b/lib/tests/modules/functionTo/list-order.nix new file mode 100644 index 00000000000..77a1a43a84f --- /dev/null +++ b/lib/tests/modules/functionTo/list-order.nix @@ -0,0 +1,25 @@ + +{ lib, config, ... }: +let + inherit (lib) types; +in { + options = { + fun = lib.mkOption { + type = types.functionTo (types.listOf types.str); + }; + + result = lib.mkOption { + type = types.str; + default = toString (config.fun { + a = "a"; + b = "b"; + c = "c"; + }); + }; + }; + + config.fun = lib.mkMerge [ + (input: lib.mkAfter [ input.a ]) + (input: [ input.b ]) + ]; +} -- cgit 1.4.1