Skip to content

nix derivation build #11642

Open
Open
@roberth

Description

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.

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalnew-cliRelating to the "nix" command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions