mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 19:21:04 +00:00
lib/tests/modules: Test non-strictness some more
Doesn't seem to have been a problem actually, but now it won't regress.
This commit is contained in:
parent
bfaa9426c0
commit
e8d61a25fc
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue