- Clone https://github.com/NixOS/nixpkgs as
~/nixpkgs(or whatever path you prefer).
- Make sure to
git pullif already cloned.
- Inside the Git repo, checkout the latest tag
git checkout <YY-MM>.
- Use to get recent tags:
git tag --list '[0-9][0-9].*' --sort=creatordate | tail.
- Rebuild NixOS with this path:
nixos-rebuild switch -I nixpkgs=~/nixpkgs.