Skip to content

Change all packages from "name" to "pname"+"version", remove all uses of meta.version and meta.tag #103997

@nh2

Description

@nh2

It seems like there isn't a tracking issue about this long-term effort yet (e.g. to mention in commit messages and to make it sprintable).

Nixpkgs moved to an explicit versioning scheme, with the plan to change all packages like so:

-name = "mypackage-1.2.3";
+pname = "mypackage";
+version = "1.2.3";

See the sprint checkbox list for the remaining packages: #103997 (comment)

This obviates meta.version and meta.tag; they should be removed (as discussed in #12156).

Tangentially related: Where to put unstable versions / package names (see #68518).

Details on what's right and what isn't

Note that the following pattern is not good because it still uses name:

let
  pname = "mypackage";
  version = "1.2.3";
in
  mkDerivation {
    name = "${pname}-${version}";
  }

In the new approach, pname and version have to be given directly to mkDerivation.

You can use mkDerivation rec to be able to re-use e.g. version in src or other fields:

mkDerivation rec {
  pname = "mypackage";
  version = "1.2.3";

  src = {
    ... expression using `version` variable here ...
  };
}

Automation

You can link big treewide efforts/PRs here (tick merged ones):

Tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.3.skill: sprintableA larger issue which is split into distinct actionable tasks5.scope: trackingLong-lived issue tracking long-term fixes or multiple sub-problems6.topic: repologyhttps://repology.org/

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions