lib/modules: Switch _module.args from attrsOf to lazyAttrsOf

This commit is contained in:
Silvan Mosberger 2019-10-03 00:12:47 +02:00 committed by Silvan Mosberger
parent ab10e87414
commit 9e97e64847
No known key found for this signature in database
GPG key ID: E8F1E9EAD284E17D

View file

@ -41,7 +41,13 @@ rec {
options = {
_module.args = mkOption {
type = types.attrsOf types.unspecified;
# Because things like `mkIf` are entirely useless for
# `_module.args` (because there's no way modules can check which
# arguments were passed), we'll use `lazyAttrsOf` which drops
# support for that, in turn it's lazy in its values. This means e.g.
# a `_module.args.pkgs = import (fetchTarball { ... }) {}` won't
# start a download when `pkgs` wasn't evaluated.
type = types.lazyAttrsOf types.unspecified;
internal = true;
description = "Arguments passed to each module.";
};