Skip to content

Add support for --all to nix build#15275

Draft
lisanna-dettwyler wants to merge 1 commit intoNixOS:masterfrom
lisanna-dettwyler:build-all
Draft

Add support for --all to nix build#15275
lisanna-dettwyler wants to merge 1 commit intoNixOS:masterfrom
lisanna-dettwyler:build-all

Conversation

@lisanna-dettwyler
Copy link
Contributor

Resolves #7165

TODO:

  • Add test
  • Refactor common logic out of completeFlakeRefWithFragment() so we're not abusing a completion function
  • Accept argument to --all which is the fragment to apply to the flakes, e.g. .devShells rather than just getting default completions

Is it OK to abuse RawInstallables as specifying flakes to build --all from? I think so, because normally a flake installable arg evaluates to flake#.packages.<system>.default so there is precedent for this.

By doing it this way, it automatically does the right thing for multiple out links.

Motivation

This is a very popular requested feature.

Context

This is a WIP POC that I will refine.

#7165


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Resolves NixOS#7165

Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
@edolstra
Copy link
Member

It probably shouldn't be named --all because that already means "every store path in the Nix store" in commands like nix path-info.

It would probably be best to wait until we have flake schemas (DeterminateSystems#217), because then we have a non-ad-hoc way of querying all the buildable flake outputs.

Another consideration: we do already have a way to build all flake outputs, namely nix flake check. However, it doesn't create symlinks to the outputs.

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.

nix build --all: build all packages in a flake

2 participants

Comments