git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit769eac074045b86fd4a6e4b492959bb514befd3d authorSilvan Mosberger <contact@infinisil.com> dateTue 29 Sep 2020, 22:34 (6 years ago) parent1063be8
1 file changed+2−2
lib/modules.nix+2−2
lib/modules.nix+2−2
@@ -224,7 +224,7 @@ rec {
224224 if badAttrs != {} then
225225 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."
226226 else
227− { _file = m._file or file;
227+ { _file = toString m._file or file;
228228 key = toString m.key or key;
229229 disabledModules = m.disabledModules or [];
230230 imports = m.imports or [];
@@ -232,7 +232,7 @@ rec {
232232 config = addFreeformType (addMeta (m.config or {}));
233233 }
234234 else
235− { _file = m._file or file;
235+ { _file = toString m._file or file;
236236 key = toString m.key or key;
237237 disabledModules = m.disabledModules or [];
238238 imports = m.require or [] ++ m.imports or [];