Skip to content

Use builtins.unsafeGetAttrPos or similar to provide better module system locations #15417

@copumpkin

Description

@copumpkin

Currently, if I import modules (I'm using the module system for something other than NixOS) that are not top-level files, errors will be reported similarly to:

 The option `foo' defined in `<unknown-file>' does not exist.

I think <unknown-file> could be improved by using unsafeGetAttrPos to try a bit harder to figure out where the module is defined. It obviously still won't work in all cases, but it will probably work in more cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: module systemAbout "NixOS" module system internals
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions