Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

organist.import_nix doesn't work with outputs from the current flake #186

Open
mboes opened this issue Jan 28, 2024 · 2 comments
Open

organist.import_nix doesn't work with outputs from the current flake #186

mboes opened this issue Jan 28, 2024 · 2 comments

Comments

@mboes
Copy link

mboes commented Jan 28, 2024

Say you have a flake output called foo, such that the following works:

$ nix build .#foo

I would expect organist.import_nix ".#foo", say in a project.ncl, to evaluate to a Nix path. Actual:

error: Missing input "..foo"

This is despite the fact that https://github.com/nickel-lang/organist/blob/main/lib/nix-interop/derivation.ncl#L258-L262 claims:

This follows the same search rules as the nix build cli, namely that the library will consider the first valid values within:
- InputPath
- "packages".system.InputPath
- "legacyPackages".system.InputPath

@thufschmitt
Copy link
Member

Mh, I see how that comment can be misleading (and the error message a bit too, although that should be fixed by 7e6c7f8).

The search rules are a purely Nix-language level thing, they don't interact with the command-line – and .#foo only makes sense at the command-line. The current flake is referred to as self in the language — so you want organist.import_nix "self#foo".

I'll try to improve the wording to make this more explicit

@mboes
Copy link
Author

mboes commented Feb 7, 2024

I see. Shows my ignorance of most things flakes. Like you say though, if the quality of diagnostics could be improved that would be great.

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

No branches or pull requests

2 participants