aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/lib/tests/modules
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/lib/tests/modules')
-rw-r--r--nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix55
-rw-r--r--nixpkgs/lib/tests/modules/alias-with-priority.nix55
-rw-r--r--nixpkgs/lib/tests/modules/declare-coerced-value-unsound.nix10
-rw-r--r--nixpkgs/lib/tests/modules/declare-coerced-value.nix10
-rw-r--r--nixpkgs/lib/tests/modules/declare-either.nix5
-rw-r--r--nixpkgs/lib/tests/modules/declare-enable.nix14
-rw-r--r--nixpkgs/lib/tests/modules/declare-int-between-value.nix9
-rw-r--r--nixpkgs/lib/tests/modules/declare-int-positive-value.nix9
-rw-r--r--nixpkgs/lib/tests/modules/declare-int-unsigned-value.nix9
-rw-r--r--nixpkgs/lib/tests/modules/declare-loaOfSub-any-enable.nix29
-rw-r--r--nixpkgs/lib/tests/modules/declare-oneOf.nix9
-rw-r--r--nixpkgs/lib/tests/modules/default.nix8
-rw-r--r--nixpkgs/lib/tests/modules/define-_module-args-custom.nix7
-rw-r--r--nixpkgs/lib/tests/modules/define-enable-force.nix5
-rw-r--r--nixpkgs/lib/tests/modules/define-enable-with-custom-arg.nix7
-rw-r--r--nixpkgs/lib/tests/modules/define-enable.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-force-enable.nix5
-rw-r--r--nixpkgs/lib/tests/modules/define-force-loaOfSub-foo-enable.nix5
-rw-r--r--nixpkgs/lib/tests/modules/define-if-loaOfSub-foo-enable.nix5
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-bar-enable.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-bar.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-force.nix5
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-if.nix5
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-foo-force-enable.nix7
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-foo-if-enable.nix7
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-foo.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-force-foo-enable.nix7
-rw-r--r--nixpkgs/lib/tests/modules/define-loaOfSub-if-foo-enable.nix7
-rw-r--r--nixpkgs/lib/tests/modules/define-module-check.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-value-int-negative.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-value-int-positive.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-value-int-zero.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-value-list.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-value-string-arbitrary.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-value-string-bigint.nix3
-rw-r--r--nixpkgs/lib/tests/modules/define-value-string.nix3
-rw-r--r--nixpkgs/lib/tests/modules/disable-declare-enable.nix5
-rw-r--r--nixpkgs/lib/tests/modules/disable-define-enable.nix5
-rw-r--r--nixpkgs/lib/tests/modules/disable-enable-modules.nix5
-rw-r--r--nixpkgs/lib/tests/modules/import-custom-arg.nix6
-rw-r--r--nixpkgs/lib/tests/modules/loaOf-with-long-list.nix19
-rw-r--r--nixpkgs/lib/tests/modules/loaOf-with-many-list-merges.nix19
43 files changed, 392 insertions, 0 deletions
diff --git a/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix b/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix
new file mode 100644
index 00000000000..9a18c9d9f61
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix
@@ -0,0 +1,55 @@
+# This is a test to show that mkAliasOptionModule sets the priority correctly
+# for aliased options.
+#
+# This test shows that an alias with a high priority is able to override
+# a non-aliased option.
+
+{ config, lib, ... }:
+
+with lib;
+
+{
+ options = {
+ # A simple boolean option that can be enabled or disabled.
+ enable = lib.mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ example = true;
+ description = ''
+ Some descriptive text
+ '';
+ };
+
+ # mkAliasOptionModule sets warnings, so this has to be defined.
+ warnings = mkOption {
+ internal = true;
+ default = [];
+ type = types.listOf types.str;
+ example = [ "The `foo' service is deprecated and will go away soon!" ];
+ description = ''
+ This option allows modules to show warnings to users during
+ the evaluation of the system configuration.
+ '';
+ };
+ };
+
+ imports = [
+ # Create an alias for the "enable" option.
+ (mkAliasOptionModule [ "enableAlias" ] [ "enable" ])
+
+ # Disable the aliased option with a high priority so it
+ # should override the next import.
+ ( { config, lib, ... }:
+ {
+ enableAlias = lib.mkForce false;
+ }
+ )
+
+ # Enable the normal (non-aliased) option.
+ ( { config, lib, ... }:
+ {
+ enable = true;
+ }
+ )
+ ];
+}
diff --git a/nixpkgs/lib/tests/modules/alias-with-priority.nix b/nixpkgs/lib/tests/modules/alias-with-priority.nix
new file mode 100644
index 00000000000..a35a06fc697
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/alias-with-priority.nix
@@ -0,0 +1,55 @@
+# This is a test to show that mkAliasOptionModule sets the priority correctly
+# for aliased options.
+#
+# This test shows that an alias with a low priority is able to be overridden
+# with a non-aliased option.
+
+{ config, lib, ... }:
+
+with lib;
+
+{
+ options = {
+ # A simple boolean option that can be enabled or disabled.
+ enable = lib.mkOption {
+ type = types.nullOr types.bool;
+ default = null;
+ example = true;
+ description = ''
+ Some descriptive text
+ '';
+ };
+
+ # mkAliasOptionModule sets warnings, so this has to be defined.
+ warnings = mkOption {
+ internal = true;
+ default = [];
+ type = types.listOf types.str;
+ example = [ "The `foo' service is deprecated and will go away soon!" ];
+ description = ''
+ This option allows modules to show warnings to users during
+ the evaluation of the system configuration.
+ '';
+ };
+ };
+
+ imports = [
+ # Create an alias for the "enable" option.
+ (mkAliasOptionModule [ "enableAlias" ] [ "enable" ])
+
+ # Disable the aliased option, but with a default (low) priority so it
+ # should be able to be overridden by the next import.
+ ( { config, lib, ... }:
+ {
+ enableAlias = lib.mkDefault false;
+ }
+ )
+
+ # Enable the normal (non-aliased) option.
+ ( { config, lib, ... }:
+ {
+ enable = true;
+ }
+ )
+ ];
+}
diff --git a/nixpkgs/lib/tests/modules/declare-coerced-value-unsound.nix b/nixpkgs/lib/tests/modules/declare-coerced-value-unsound.nix
new file mode 100644
index 00000000000..7a017f24e77
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-coerced-value-unsound.nix
@@ -0,0 +1,10 @@
+{ lib, ... }:
+
+{
+ options = {
+ value = lib.mkOption {
+ default = "12";
+ type = lib.types.coercedTo lib.types.str lib.toInt lib.types.ints.s8;
+ };
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-coerced-value.nix b/nixpkgs/lib/tests/modules/declare-coerced-value.nix
new file mode 100644
index 00000000000..76b12ad53f0
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-coerced-value.nix
@@ -0,0 +1,10 @@
+{ lib, ... }:
+
+{
+ options = {
+ value = lib.mkOption {
+ default = 42;
+ type = lib.types.coercedTo lib.types.int builtins.toString lib.types.str;
+ };
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-either.nix b/nixpkgs/lib/tests/modules/declare-either.nix
new file mode 100644
index 00000000000..5a0fa978a13
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-either.nix
@@ -0,0 +1,5 @@
+{ lib, ... }: {
+ options.value = lib.mkOption {
+ type = lib.types.either lib.types.int lib.types.str;
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-enable.nix b/nixpkgs/lib/tests/modules/declare-enable.nix
new file mode 100644
index 00000000000..ebee243c756
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-enable.nix
@@ -0,0 +1,14 @@
+{ lib, ... }:
+
+{
+ options = {
+ enable = lib.mkOption {
+ default = false;
+ example = true;
+ type = lib.types.bool;
+ description = ''
+ Some descriptive text
+ '';
+ };
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-int-between-value.nix b/nixpkgs/lib/tests/modules/declare-int-between-value.nix
new file mode 100644
index 00000000000..8b2624cc5d6
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-int-between-value.nix
@@ -0,0 +1,9 @@
+{ lib, ... }:
+
+{
+ options = {
+ value = lib.mkOption {
+ type = lib.types.ints.between (-21) 43;
+ };
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-int-positive-value.nix b/nixpkgs/lib/tests/modules/declare-int-positive-value.nix
new file mode 100644
index 00000000000..6e48c6ac8fe
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-int-positive-value.nix
@@ -0,0 +1,9 @@
+{ lib, ... }:
+
+{
+ options = {
+ value = lib.mkOption {
+ type = lib.types.ints.positive;
+ };
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-int-unsigned-value.nix b/nixpkgs/lib/tests/modules/declare-int-unsigned-value.nix
new file mode 100644
index 00000000000..05d0eff01c9
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-int-unsigned-value.nix
@@ -0,0 +1,9 @@
+{ lib, ... }:
+
+{
+ options = {
+ value = lib.mkOption {
+ type = lib.types.ints.unsigned;
+ };
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-loaOfSub-any-enable.nix b/nixpkgs/lib/tests/modules/declare-loaOfSub-any-enable.nix
new file mode 100644
index 00000000000..71dad1c9135
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-loaOfSub-any-enable.nix
@@ -0,0 +1,29 @@
+{ lib, ... }:
+
+let
+ submod = { ... }: {
+ options = {
+ enable = lib.mkOption {
+ default = false;
+ example = true;
+ type = lib.types.bool;
+ description = ''
+ Some descriptive text
+ '';
+ };
+ };
+ };
+in
+
+{
+ options = {
+ loaOfSub = lib.mkOption {
+ default = {};
+ example = {};
+ type = lib.types.loaOf (lib.types.submodule [ submod ]);
+ description = ''
+ Some descriptive text
+ '';
+ };
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/declare-oneOf.nix b/nixpkgs/lib/tests/modules/declare-oneOf.nix
new file mode 100644
index 00000000000..df092a14f81
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/declare-oneOf.nix
@@ -0,0 +1,9 @@
+{ lib, ... }: {
+ options.value = lib.mkOption {
+ type = lib.types.oneOf [
+ lib.types.int
+ (lib.types.listOf lib.types.int)
+ lib.types.str
+ ];
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/default.nix b/nixpkgs/lib/tests/modules/default.nix
new file mode 100644
index 00000000000..5b094710419
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/default.nix
@@ -0,0 +1,8 @@
+{ lib ? import ../.., modules ? [] }:
+
+{
+ inherit (lib.evalModules {
+ inherit modules;
+ specialArgs.modulesPath = ./.;
+ }) config options;
+}
diff --git a/nixpkgs/lib/tests/modules/define-_module-args-custom.nix b/nixpkgs/lib/tests/modules/define-_module-args-custom.nix
new file mode 100644
index 00000000000..e565fd215a5
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-_module-args-custom.nix
@@ -0,0 +1,7 @@
+{ lib, ... }:
+
+{
+ config = {
+ _module.args.custom = true;
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/define-enable-force.nix b/nixpkgs/lib/tests/modules/define-enable-force.nix
new file mode 100644
index 00000000000..f4990a32863
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-enable-force.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ enable = lib.mkForce false;
+}
diff --git a/nixpkgs/lib/tests/modules/define-enable-with-custom-arg.nix b/nixpkgs/lib/tests/modules/define-enable-with-custom-arg.nix
new file mode 100644
index 00000000000..7da74671d14
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-enable-with-custom-arg.nix
@@ -0,0 +1,7 @@
+{ lib, custom, ... }:
+
+{
+ config = {
+ enable = custom;
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/define-enable.nix b/nixpkgs/lib/tests/modules/define-enable.nix
new file mode 100644
index 00000000000..7dc26010ae5
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-enable.nix
@@ -0,0 +1,3 @@
+{
+ enable = true;
+}
diff --git a/nixpkgs/lib/tests/modules/define-force-enable.nix b/nixpkgs/lib/tests/modules/define-force-enable.nix
new file mode 100644
index 00000000000..978caa2a8c0
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-force-enable.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+lib.mkForce {
+ enable = false;
+}
diff --git a/nixpkgs/lib/tests/modules/define-force-loaOfSub-foo-enable.nix b/nixpkgs/lib/tests/modules/define-force-loaOfSub-foo-enable.nix
new file mode 100644
index 00000000000..bfd8e084b59
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-force-loaOfSub-foo-enable.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+lib.mkForce {
+ loaOfSub.foo.enable = false;
+}
diff --git a/nixpkgs/lib/tests/modules/define-if-loaOfSub-foo-enable.nix b/nixpkgs/lib/tests/modules/define-if-loaOfSub-foo-enable.nix
new file mode 100644
index 00000000000..4288d74dec0
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-if-loaOfSub-foo-enable.nix
@@ -0,0 +1,5 @@
+{ config, lib, ... }:
+
+lib.mkIf config.enable {
+ loaOfSub.foo.enable = true;
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-bar-enable.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-bar-enable.nix
new file mode 100644
index 00000000000..422bb0a600b
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-bar-enable.nix
@@ -0,0 +1,3 @@
+{
+ loaOfSub.bar.enable = true;
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-bar.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-bar.nix
new file mode 100644
index 00000000000..c24315e09b6
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-bar.nix
@@ -0,0 +1,3 @@
+{
+ loaOfSub.bar = {};
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-force.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-force.nix
new file mode 100644
index 00000000000..c1d7b198be5
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-force.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ loaOfSub.foo.enable = lib.mkForce false;
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-if.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-if.nix
new file mode 100644
index 00000000000..44b2c96cd02
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable-if.nix
@@ -0,0 +1,5 @@
+{ config, lib, ... }:
+
+{
+ loaOfSub.foo.enable = lib.mkIf config.enable true;
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable.nix
new file mode 100644
index 00000000000..822425c71bb
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-enable.nix
@@ -0,0 +1,3 @@
+{
+ loaOfSub.foo.enable = true;
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-foo-force-enable.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-force-enable.nix
new file mode 100644
index 00000000000..dce0ef547b3
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-force-enable.nix
@@ -0,0 +1,7 @@
+{ lib, ... }:
+
+{
+ loaOfSub.foo = lib.mkForce {
+ enable = false;
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-foo-if-enable.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-if-enable.nix
new file mode 100644
index 00000000000..236b2840ee5
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-foo-if-enable.nix
@@ -0,0 +1,7 @@
+{ config, lib, ... }:
+
+{
+ loaOfSub.foo = lib.mkIf config.enable {
+ enable = true;
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-foo.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-foo.nix
new file mode 100644
index 00000000000..e9b2e631f2e
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-foo.nix
@@ -0,0 +1,3 @@
+{
+ loaOfSub.foo = {};
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-force-foo-enable.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-force-foo-enable.nix
new file mode 100644
index 00000000000..df5722274ee
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-force-foo-enable.nix
@@ -0,0 +1,7 @@
+{ lib, ... }:
+
+{
+ loaOfSub = lib.mkForce {
+ foo.enable = false;
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/define-loaOfSub-if-foo-enable.nix b/nixpkgs/lib/tests/modules/define-loaOfSub-if-foo-enable.nix
new file mode 100644
index 00000000000..bd2d068d31a
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-loaOfSub-if-foo-enable.nix
@@ -0,0 +1,7 @@
+{ config, lib, ... }:
+
+{
+ loaOfSub = lib.mkIf config.enable {
+ foo.enable = true;
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/define-module-check.nix b/nixpkgs/lib/tests/modules/define-module-check.nix
new file mode 100644
index 00000000000..5a0707c975f
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-module-check.nix
@@ -0,0 +1,3 @@
+{
+ _module.check = false;
+}
diff --git a/nixpkgs/lib/tests/modules/define-value-int-negative.nix b/nixpkgs/lib/tests/modules/define-value-int-negative.nix
new file mode 100644
index 00000000000..a041222987a
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-value-int-negative.nix
@@ -0,0 +1,3 @@
+{
+ value = -23;
+}
diff --git a/nixpkgs/lib/tests/modules/define-value-int-positive.nix b/nixpkgs/lib/tests/modules/define-value-int-positive.nix
new file mode 100644
index 00000000000..5803de17263
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-value-int-positive.nix
@@ -0,0 +1,3 @@
+{
+ value = 42;
+}
diff --git a/nixpkgs/lib/tests/modules/define-value-int-zero.nix b/nixpkgs/lib/tests/modules/define-value-int-zero.nix
new file mode 100644
index 00000000000..68bb9f415c3
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-value-int-zero.nix
@@ -0,0 +1,3 @@
+{
+ value = 0;
+}
diff --git a/nixpkgs/lib/tests/modules/define-value-list.nix b/nixpkgs/lib/tests/modules/define-value-list.nix
new file mode 100644
index 00000000000..4831c1cc09b
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-value-list.nix
@@ -0,0 +1,3 @@
+{
+ value = [];
+}
diff --git a/nixpkgs/lib/tests/modules/define-value-string-arbitrary.nix b/nixpkgs/lib/tests/modules/define-value-string-arbitrary.nix
new file mode 100644
index 00000000000..8e3abaf536a
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-value-string-arbitrary.nix
@@ -0,0 +1,3 @@
+{
+ value = "foobar";
+}
diff --git a/nixpkgs/lib/tests/modules/define-value-string-bigint.nix b/nixpkgs/lib/tests/modules/define-value-string-bigint.nix
new file mode 100644
index 00000000000..f27e31985c9
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-value-string-bigint.nix
@@ -0,0 +1,3 @@
+{
+ value = "1000";
+}
diff --git a/nixpkgs/lib/tests/modules/define-value-string.nix b/nixpkgs/lib/tests/modules/define-value-string.nix
new file mode 100644
index 00000000000..e7a166965a7
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/define-value-string.nix
@@ -0,0 +1,3 @@
+{
+ value = "24";
+}
diff --git a/nixpkgs/lib/tests/modules/disable-declare-enable.nix b/nixpkgs/lib/tests/modules/disable-declare-enable.nix
new file mode 100644
index 00000000000..a373ee7e550
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/disable-declare-enable.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ disabledModules = [ ./declare-enable.nix ];
+}
diff --git a/nixpkgs/lib/tests/modules/disable-define-enable.nix b/nixpkgs/lib/tests/modules/disable-define-enable.nix
new file mode 100644
index 00000000000..0d84a7c3cb6
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/disable-define-enable.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ disabledModules = [ ./define-enable.nix ];
+}
diff --git a/nixpkgs/lib/tests/modules/disable-enable-modules.nix b/nixpkgs/lib/tests/modules/disable-enable-modules.nix
new file mode 100644
index 00000000000..c325f4e0743
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/disable-enable-modules.nix
@@ -0,0 +1,5 @@
+{ lib, ... }:
+
+{
+ disabledModules = [ "define-enable.nix" "declare-enable.nix" ];
+}
diff --git a/nixpkgs/lib/tests/modules/import-custom-arg.nix b/nixpkgs/lib/tests/modules/import-custom-arg.nix
new file mode 100644
index 00000000000..3e687b661c1
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/import-custom-arg.nix
@@ -0,0 +1,6 @@
+{ lib, custom, ... }:
+
+{
+ imports = []
+ ++ lib.optional custom ./define-enable-force.nix;
+}
diff --git a/nixpkgs/lib/tests/modules/loaOf-with-long-list.nix b/nixpkgs/lib/tests/modules/loaOf-with-long-list.nix
new file mode 100644
index 00000000000..f30903c47e5
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/loaOf-with-long-list.nix
@@ -0,0 +1,19 @@
+{ config, lib, ... }:
+
+{
+ options = {
+ loaOfInt = lib.mkOption {
+ type = lib.types.loaOf lib.types.int;
+ };
+
+ result = lib.mkOption {
+ type = lib.types.str;
+ };
+ };
+
+ config = {
+ loaOfInt = [ 1 2 3 4 5 6 7 8 9 10 ];
+
+ result = toString (lib.attrValues config.loaOfInt);
+ };
+}
diff --git a/nixpkgs/lib/tests/modules/loaOf-with-many-list-merges.nix b/nixpkgs/lib/tests/modules/loaOf-with-many-list-merges.nix
new file mode 100644
index 00000000000..f8f8a8da82b
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/loaOf-with-many-list-merges.nix
@@ -0,0 +1,19 @@
+{ config, lib, ... }:
+
+{
+ options = {
+ loaOfInt = lib.mkOption {
+ type = lib.types.loaOf lib.types.int;
+ };
+
+ result = lib.mkOption {
+ type = lib.types.str;
+ };
+ };
+
+ config = {
+ loaOfInt = lib.mkMerge (map lib.singleton [ 1 2 3 4 5 6 7 8 9 10 ]);
+
+ result = toString (lib.attrValues config.loaOfInt);
+ };
+}