Skip to content

Suggest git add -N when that would fix a file not being found in a flake #8389

@remexre

Description

@remexre

Is your feature request related to a problem? Please describe.

A common "oh, right, I forgot about that" when switching to flakes is not having remembered to git add files after creating them. The current error message is

error: getting status of '/nix/store/vlks3d7fr5ywc923pvqacx2bkzm1782j-source/foo': No such file or directory

If you're not expecting this behavior, this is a confusing error!

Describe the solution you'd like

When evaluation of a path expression in a flake results in a path that is not in the flake in the Nix store, but is in the original sources (and the original sources use Git), the error message should note that the error may be because the file is untracked.

It may also suggest git add -N to resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-messagesConfusing messages and better diagnosticsfeatureFeature request or proposalflakes
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions