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

nix: allow top-level installables #3169

Closed
wants to merge 1 commit into from

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Oct 27, 2019

This brings a missing feature from the v1 CLI.

Old syntax: nix-build default.nix

New syntax: nix build -f default.nix .

Currently the v2 CLI can only build installables if they are part of a returnd attribute set, like nixpkgs.

This brings a missing feature from the v1 CLI.

Old syntax: `nix-build default.nix`

New syntax: `nix build -f default.nix .`
@zimbatm zimbatm requested a review from edolstra October 27, 2019 13:48
@edolstra
Copy link
Member

nix build -f . '' would also work right?

@zimbatm
Copy link
Member Author

zimbatm commented Oct 28, 2019

Yes technically :)

Or what do you think of making the top-level installable as the default if -f is being used?

@zimbatm
Copy link
Member Author

zimbatm commented Nov 3, 2019

The issue right now is that the capability is not discoverable, so my main goal is to improve on that.

Most times where -f is being used, it makes sense to default to building the top-level. It's a different context than building nixpkgs.

Another solution is to just document it properly, with examples added to the CLI.

@edolstra
Copy link
Member

edolstra commented Nov 5, 2019

Hm, turns out that nix build -f default.nix (without any . or empty argument) already works. (Or equivalently, nix build -f .). Isn't that what you want?

@zimbatm
Copy link
Member Author

zimbatm commented Nov 6, 2019

How embarrassing. I remember now that this used to be the cased and then you fixed it.

nix eval -f . hasn't been fixed yet though.

@edolstra
Copy link
Member

nix eval -f . now also works (ca8caae).

@edolstra edolstra closed this Nov 26, 2019
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.

None yet

2 participants