Skip to content

"error: path '/nix/store/something.nix' does not exist" when using nix-inspect with flake that includes files from parent directory #22

Description

@DerRockWolf

I get the following error:
Image

Reproduction

Directory Structure

  • something.nix
  • flake.nix
  • subdir
    • flake.nix

Files

something.nix:

{ some = "thing"; }

flake.nix:

{
  outputs = _: {
    something = import ./something.nix;
  };
}

subdir/flake.nix:

{
  outputs = _: {
    something = import ../something.nix;
  };
}

Steps

via repl:

cd subdir
nix repl
:lf .
outputs.something

Accessing outputs.something with nix-inspect -p subdir results in the above mentioned error. When accessing it via the root flake it works.

While building the reproduction I've noticed that the error also occurs when using nix repl but only if the root directory is not a git repository.

So maybe my use-case is also a bit strange: I have a "public facing" flake and an "internal" flake. Both import the same files/functions but pass different arguments. The "internal" flake is in a sub directory, the "public" flake at the root.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions