Created
November 9, 2021 20:00
-
-
Save matthiasbeyer/a3879a43e56284595e27c05f92cef24f to your computer and use it in GitHub Desktop.
Using a specific nixpkgs version to install a package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? (import <nixpkgs> {}) }: | |
rec { | |
# import nixpkgs from a specific commit hash | |
oldNixpkgs = pkgs.fetchFromGitHub { | |
owner = "nixos"; | |
repo = "nixpkgs"; | |
# here goes the commit hash | |
rev = "c2268175651c4aa1da23c1b84ecebc0a0df56633"; | |
sha256 = "0asjhmzwgipbmv3l58l4g4miw6mhywpzzviirys1r33ykbacvjkf"; | |
}; | |
# import the "old" packages | |
oldPkgs = import "${oldNixpkgs}" {}; | |
# use the oldPkgs and use the "ripgrep" package | |
myRipgrep = oldPkgs.ripgrep; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment