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 derivation build #11642

Open
roberth opened this issue Oct 7, 2024 · 0 comments
Open

nix derivation build #11642

roberth opened this issue Oct 7, 2024 · 0 comments
Labels
feature Feature request or proposal new-cli Relating to the "nix" command

Comments

@roberth
Copy link
Member

roberth commented Oct 7, 2024

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

nix build merely creates whatever it is that you pass to it. If that's a derivation path, it doesn't build it. That's a valid behavior despite its name. (I've previously proposed nix create for this behavior, but I can accept this quirk)

Another issue is that it does too much. Not only does it run the builder; it also copies outputs to the store. This may not be useful or desired, for instance when invoking nix in CI.

Describe the solution you'd like

nix derivation build - as a plumbing command - promises very little: only run the builder, (locally or remotely) and don't bother with outputs.

This should require a derivation path, so as not to suffer from the naming problem that nix build has. To build the derivation backing a certain output, add the store level derivationOf operator, ^..

This would make sense to me, but needs validation by actual users (I don't call the nix CLI; I let Hercules CI handle such minutiae for me).

Describe alternatives you've considered

Maybe nix derivation build is expected to be an alias of nix build or vice versa?

  • This makes nix-fast-build partially obsolete, and that's a good thing.

  • Some destination store parameter, which could be set to empty. I don't like flags that remove functionality. Doing too much shouldn't be the default - it leads to bloated interfaces.

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal new-cli Relating to the "nix" command labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal new-cli Relating to the "nix" command
Projects
None yet
Development

No branches or pull requests

1 participant