diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-11-03 19:19:41 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-11-03 19:19:41 +0100 |
commit | e8d61a25fcb5e11da8af0792da27a896bf87ba65 (patch) | |
tree | d9e897dd4653b6d743659ba404cd98e82525c9d8 /lib/tests | |
parent | bfaa9426c0e70b387f58bce6248b454b556018c2 (diff) | |
download | nixpkgs-e8d61a25fcb5e11da8af0792da27a896bf87ba65.tar nixpkgs-e8d61a25fcb5e11da8af0792da27a896bf87ba65.tar.gz nixpkgs-e8d61a25fcb5e11da8af0792da27a896bf87ba65.tar.bz2 nixpkgs-e8d61a25fcb5e11da8af0792da27a896bf87ba65.tar.lz nixpkgs-e8d61a25fcb5e11da8af0792da27a896bf87ba65.tar.xz nixpkgs-e8d61a25fcb5e11da8af0792da27a896bf87ba65.tar.zst nixpkgs-e8d61a25fcb5e11da8af0792da27a896bf87ba65.zip |
lib/tests/modules: Test non-strictness some more
Doesn't seem to have been a problem actually, but now it won't regress.
Diffstat (limited to 'lib/tests')
-rw-r--r-- | lib/tests/modules/declare-attrsOf.nix | 9 | ||||
-rw-r--r-- | lib/tests/modules/freeform-nested.nix | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/tests/modules/declare-attrsOf.nix b/lib/tests/modules/declare-attrsOf.nix index b3999de7e5f..d19964064b2 100644 --- a/lib/tests/modules/declare-attrsOf.nix +++ b/lib/tests/modules/declare-attrsOf.nix @@ -1,6 +1,13 @@ -{ lib, ... }: { +{ lib, ... }: +let + deathtrapArgs = lib.mapAttrs + (k: _: throw "The module system is too strict, accessing an unused option's ${k} mkOption-attribute.") + (lib.functionArgs lib.mkOption); +in +{ options.value = lib.mkOption { type = lib.types.attrsOf lib.types.str; default = {}; }; + options.testing-laziness-so-don't-read-me = lib.mkOption deathtrapArgs; } diff --git a/lib/tests/modules/freeform-nested.nix b/lib/tests/modules/freeform-nested.nix index 5da27f5a8b4..b81fa7f0d22 100644 --- a/lib/tests/modules/freeform-nested.nix +++ b/lib/tests/modules/freeform-nested.nix @@ -1,7 +1,14 @@ -{ lib, ... }: { +{ lib, ... }: +let + deathtrapArgs = lib.mapAttrs + (k: _: throw "The module system is too strict, accessing an unused option's ${k} mkOption-attribute.") + (lib.functionArgs lib.mkOption); +in +{ options.nest.foo = lib.mkOption { type = lib.types.bool; default = false; }; + options.nest.unused = lib.mkOption deathtrapArgs; config.nest.bar = "bar"; } |