diff options
author | Silvan Mosberger <contact@infinisil.com> | 2020-09-29 22:34:44 +0200 |
---|---|---|
committer | Silvan Mosberger <contact@infinisil.com> | 2020-09-29 22:47:58 +0200 |
commit | 769eac074045b86fd4a6e4b492959bb514befd3d (patch) | |
tree | 858f46e60505ef7087eba049e6f65e0b26ce9487 | |
parent | 1063be86e90758b43f49b6ceb1164205bd8100f7 (diff) |
lib/modules: Make sure to not import module _file's into the store
Previously if `_file` was specified by a module:
trace: warning: The type `types.string' of option `foo' defined in `/nix/store/yxhm2il5yrb92fldgriw0wyqh2kk9qyc-bug.nix' is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
With this change:
trace: warning: The type `types.string' of option `foo' defined in `/home/infinisil/src/nixpkgs/bug.nix' is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
-rw-r--r-- | lib/modules.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index 02a669df6593..5a3a268cafa3 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -224,7 +224,7 @@ rec { if badAttrs != {} then throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: ${toString (attrNames badAttrs)}) into the explicit `config' attribute." else - { _file = m._file or file; + { _file = toString m._file or file; key = toString m.key or key; disabledModules = m.disabledModules or []; imports = m.imports or []; @@ -232,7 +232,7 @@ rec { config = addFreeformType (addMeta (m.config or {})); } else - { _file = m._file or file; + { _file = toString m._file or file; key = toString m.key or key; disabledModules = m.disabledModules or []; imports = m.require or [] ++ m.imports or []; |