Skip to content

docs: recommend setting moduleLocation by default#221

Open
Atry wants to merge 1 commit intohercules-ci:mainfrom
Atry:patch-2
Open

docs: recommend setting moduleLocation by default#221
Atry wants to merge 1 commit intohercules-ci:mainfrom
Atry:patch-2

Conversation

@Atry
Copy link
Copy Markdown
Contributor

@Atry Atry commented Apr 14, 2024

As moduleLocation can be used to avoid portential infinite loops issue, it would be nice to mention it from README.

As `moduleLocation` can be used to avoid portential infinite loops issue, it would be nice to mention it from README.
@roberth
Copy link
Copy Markdown
Member

roberth commented Apr 14, 2024

Is that still needed? Did you run into this again?
If users set inputs (which almost certainly they do), Nix will use the attribute position to determine the file.
That's since #192; half a year ago.

@Atry
Copy link
Copy Markdown
Contributor Author

Atry commented Apr 14, 2024

@Atry
Copy link
Copy Markdown
Contributor Author

Atry commented Apr 14, 2024

Currently flake modules are not able to visit ./.. self.outPath is similar but it can result in infinite loops and stack overflow.

@roberth
Copy link
Copy Markdown
Member

roberth commented May 16, 2024

Currently flake modules are not able to visit ./.. self.outPath is similar but it can result in infinite loops and stack overflow.

It seems to work fine nowadays. Example: https://github.com/srid/haskell-flake/blob/e47512f9a1eda70c762a0265cf029ecdaa9ffdf3/nix/modules/project/default.nix#L19-L29

Do you have an example where moduleLocation must be set?

I'd like to avoid a situation where we make unnecessary recommendations, and I'm making an effort to make Nix provide the info robustly without unsafeGetAttrPos or self. (NixOS/nix#8908, currently blocked on a decision for NixOS/nix#10350)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants