Skip to content

Rename defaultX flake outputs to X.default #5532

@edolstra

Description

@edolstra

We have a couple of flake outputs that have a corresponding "default" flake output, e.g.

  • packages and defaultPackage
  • devShells and devShell
  • apps and defaultApp
  • overlays and overlay
  • nixosModules and nixosModule
  • templates and defaultTemplate
  • bundlers and defaultBundler

There are also some flake outputs that lack a default, but could probably use one, like nixosConfigurations.

As can be seen above, the naming is inconsistent. It also requires a lot of special handling in commands like nix flake show and nix flake check. So I propose getting rid of all the singular flake outputs and using an attribute named default as the default. E.g.

  • defaultPackage.<system> => packages.<system>.default
  • devShell.<system> => devShells.<system>.default
  • overlay => overlays.default

Migration: we can deprecate the old singular flake outputs in 2.5 and remove support for them some time later.

Metadata

Metadata

Assignees

Labels

UXThe way in which users interact with Nix. Higher level than UI.flakesgood first issueQuick win for first-time contributors

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions