nixos-rebuild switch aborts with generic attribute‑missing error on missing module import
0 reputation · 23 Sept 2025, 17:10 UTC
NixOS Module System
When running nixos-rebuild switch with a missing or mis‑named entry in the imports list of /etc/nixos/configuration.nix, the NixOS module system aborts the build and reports a generic attribute‑missing exception.
The evaluator does not automatically indicate which file path caused the lookup failure, leaving users to trace the problem manually, especially in configurations with many nested modules.
Configuration Constraints
- Environment: NixOS 23.11 or 24.05
- Configuration: Standard
configuration.nixusing theimportsattribute
Should the rebuild command surface the offending file name in its error output? What mechanism can the evaluator use to emit such a targeted message without adding noise to the build log?