diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2019-10-03 00:12:47 +0200 |
---|---|---|
committer | Silvan Mosberger <contact@infinisil.com> | 2020-01-10 16:20:31 +0100 |
commit | 9e97e6484722e26aab3978d027e85d394f170495 (patch) | |
tree | 2ccc2bd2b3eafe4156ad1559ed01f8304d0c108b /lib/modules.nix | |
parent | ab10e874141503cee57a4e4e92d4e3c31be2a2a3 (diff) |
lib/modules: Switch _module.args from attrsOf to lazyAttrsOf
Diffstat (limited to 'lib/modules.nix')
-rw-r--r-- | lib/modules.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index 228cde002db9e..e2315290ff0dc 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -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."; }; |