Skip to content

nix profile pins nixpkgs per package #7964

@bobvanderlinden

Description

@bobvanderlinden

Installing packages from different sources results in huge downloads. I think it's not what most new users would anticipate, as it deviates from how other package managers deal with this. To make this worse, it's hard to avoid.

For example:

$ nix profile install github:nixos/nixpkgs/nixpkgs-unstable#cowsay
# A week later:
$ nix profile install github:nixos/nixpkgs/nixpkgs-unstable#vim

Now 2 different versions of nixpkgs are pinned. This behavior has a number of downsides:

  • It results in huge downloads (long waiting time)
  • It results in huge disk space usage (until all packages are upgraded and store GCed)
  • It behaves differently from most package managers, where the package manager is usually pinned to a single package set until you explicitly tell it to update the package set (apt update, pacman -y, etc).
  • It can result in incompatibilities when plugin-like libraries (like in lib/gtk-3.0, lib/qt4/plugins) are used across multiple packages from differently pinned nixpkgs. These libraries are linked against different versions of glibc, which can result in runtime problems. It's fine if the user explicitly wants to do this, but currently it's the default with nix profile.

There are some advantages to having a nixpkgs-pin per package, but currently it is the default and shouldn't be something new users need to be aware of.

  • The advantages are that the packages in nix profile are kept as-is, thus stable.
  • Upgrading individual packages is possible, usually without major problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnew-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