diff options
author | Nicolas B. Pierron <nicolas.b.pierron@gmail.com> | 2015-03-16 22:38:41 +0100 |
---|---|---|
committer | Nicolas B. Pierron <nicolas.b.pierron@gmail.com> | 2015-03-16 22:38:41 +0100 |
commit | 7f1a782d91c537eb6972b8acd83e1957a65a93e4 (patch) | |
tree | 8abc7b9905c7eb54294702ef2d1d57faf123137a /lib/tests/modules | |
parent | 05e8a48fb4af4c20134362c77ba6c5b4c6e49268 (diff) |
Add tests for the new module system improvements.
Diffstat (limited to 'lib/tests/modules')
6 files changed, 35 insertions, 0 deletions
diff --git a/lib/tests/modules/custom-arg-define-enable.nix b/lib/tests/modules/custom-arg-define-enable.nix new file mode 100644 index 000000000000..f04d30dd9b9f --- /dev/null +++ b/lib/tests/modules/custom-arg-define-enable.nix @@ -0,0 +1,8 @@ +{ lib, custom, ... }: + +{ + config = { + _module.args.custom = true; + enable = custom; + }; +} diff --git a/lib/tests/modules/define-if-loaOfSub-foo-enable.nix b/lib/tests/modules/define-if-loaOfSub-foo-enable.nix new file mode 100644 index 000000000000..4288d74dec00 --- /dev/null +++ b/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/lib/tests/modules/define-loaOfSub-foo-enable-if.nix b/lib/tests/modules/define-loaOfSub-foo-enable-if.nix new file mode 100644 index 000000000000..44b2c96cd021 --- /dev/null +++ b/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/lib/tests/modules/define-loaOfSub-foo-if-enable.nix b/lib/tests/modules/define-loaOfSub-foo-if-enable.nix new file mode 100644 index 000000000000..236b2840ee51 --- /dev/null +++ b/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/lib/tests/modules/define-loaOfSub-if-foo-enable.nix b/lib/tests/modules/define-loaOfSub-if-foo-enable.nix new file mode 100644 index 000000000000..bd2d068d31a2 --- /dev/null +++ b/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/lib/tests/modules/define-module-check.nix b/lib/tests/modules/define-module-check.nix new file mode 100644 index 000000000000..5a0707c975fa --- /dev/null +++ b/lib/tests/modules/define-module-check.nix @@ -0,0 +1,3 @@ +{ + _module.check = false; +} |