mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 15:13:46 +00:00
3c4a49f506
`m` must always be an attrset at this point. It is basically always evaluated. This will make it throw when any of the attrs is accessed, rather than just `config`. We assume that this will improve the error message in more scenarios.
21 lines
466 B
Nix
21 lines
466 B
Nix
{ config, lib, ... }:
|
|
let
|
|
inherit (lib) types mkOption setDefaultModuleLocation evalModules;
|
|
inherit (types) deferredModule lazyAttrsOf submodule str raw enum;
|
|
in
|
|
{
|
|
options = {
|
|
deferred = mkOption {
|
|
type = deferredModule;
|
|
};
|
|
result = mkOption {
|
|
default = (evalModules { modules = [ config.deferred ]; }).config.result;
|
|
};
|
|
};
|
|
config = {
|
|
deferred = { ... }:
|
|
# this should be an attrset, so this fails
|
|
true;
|
|
};
|
|
}
|