Find all versions of a package that were available in a channel and the revision you can download it from.
Click on the revision number for installation instructions.
Package | ghc |
---|---|
Version | 9.0.2 |
Channel | nixpkgs-unstable |
Revision | 79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a |
Install ghc
with nix-env
.
-env -iA ghc -f https://github.com/NixOS/nixpkgs/archive/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a.tar.gz nix
Use ghc
in a nix-shell
.
-shell -p ghc -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a.tar.gz nix
Use ghc
with nix shell
.
github:nixos/nixpkgs/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a#ghc nix shell
Install ghc
with nix profile
.
nixpkgs/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a#ghc nix profile install
Use ghc
in a nix script via tarball
let
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a.tar.gz";
}) {};
myPkg = pkgs.ghc;
in
...
Use ghc
in a nix script via Git
let
pkgs = import (builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "my-old-revision";
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixpkgs-unstable";
rev = "79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a";
}) {};
myPkg = pkgs.ghc;
in
...
Installing older versions of packages in Nix is easy but currently there is no official way to find out what revision has the package version that I need. This page provides this functionality by letting you see what versions were available in the past, when they were available, what revision to install them from, and what command to use.
The list of versions available here is not exhaustive. To check what versions of packages were ever available data was collected from past revisions in 5 weeks intervals. This means that if a package changed versions more often than every 5 weeks there may be versions missing.
During the retrieval of version information, revisions for some periods could not be successfully built for some channels and this also causes versions to be missing from the list.