Skip to content

nix check subcommand #13805

@roberth

Description

@roberth

Is your feature request related to a problem?

  • Sometimes we only want to know that a derivation is buildable, without having much interest in the output. We don't have suitable flags or commands to communicate this more limited intent.
  • nix build .#checks.<system>.foo is annoying to type and not copy-pasteable from documentation

Proposed solution

nix check subcommand, like nix build but:

  • does not produce a result symlink
  • does not substitute the outputs after determining that the realisation exists in a substituter, or (input addressed) when the outputs exist in a substituter
  • does not print output paths, and may not have a flag to enable printing
  • if possible, does not copy outputs from a remote builder (for non-IFD realisations)

Alternative solutions

A combination of

  • more nix build flags
    • not great for usability
  • adding .#checks.<system> to the attribute lookup path for nix build, after packages and legacyPackages
    • more ambiguous: a package may come with a check of the same name

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

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