Rollback nixpkgs
It is possible some software you depend on breaks in an updated nixpkgs release. If you need to roll back to a previous version of nixpkgs here an example method of using Hydra to get the last tested release of nixpkgs that contains it.
This specific example is where an update to Linux 6.6.57 breaks netfilter and we need to roll back to 6.6.56.
We go to https://Hydra.nixos.org and are presented with the Projects page.

In this example we want to roll back in the nixos-unstable branch so we select the nixos Project.

Highlighted are the release-24.05 jobset
for NixOS stable release and the trunk-combined jobset
which will be relevant to most. trunk-combined is Hydra jobset
that builds nixos-unstable.

Here is the Hydra page showing the latest evaluations for trunk-combined. Highlighted is the Jobs tab where we will search for the Linux kernel we are looking for.

Here we are searching for the job that builds the linux_6_6 kernel and select it.

We have found the last build that compiled the 6.6.56 kernel and select it.

This build of the Linux 6.6.56 kernel is the first time it was built. We can see it is part of 2 other evaluations. We want to see which nixpkgs-unstable evaluations contained this build, so we click on the "2 others".

Here we have the git commit hashes for nixpkgs that were used to generate the 3 nixpkgs-unstable evals that contained the kernel we want.
We do not want just any eval that had this kernel build in it. It could have been incomplete or failed. So we want to ensure that the build ran through the "tested" job
that is part of the trunk-combined jobset
. The tested job
runs the various tests that must pass for the NixOS channels to progress.

Select the Jobset dropdown. Notice that trunk-combined
jobset
is highligted. We select overview. But we want to open this in another windows or tab, so we have access to compare the git commit hashes we found before.

First select the jobs tab to search for jobs
. In the search field we are searching for the tested
job. After pressing enter you see similar to the above image. Select the tested
job. There is also a tested
job if you are using the stable release.

Here we notice we are on thetested
job of the trunk-combined
jobset. We compare the git commit hashes of the nixpkgs evals we got from the previous step to find the tested jobs that contain the kernel we want.
In this example we see that build 275414986 successfully passed thetested
job with the green check mark displayed.
So it is the latest nixos-unstable evaluation that has the kernel we want. We can then know that we can use 5785b6bb5eaa
git commit hash in our flake for nixpkgs to build our system and utilise the NixOS cache. (nixpkgs.url = "github:NixOS/nixpkgs/5785b6bb5eaa";
)
We also see that the first eval that had the 6.6.56 kernel failed to pass the tested job. Good thing we took this extra step to verify!

Here is the summary page of the tested build we want showing it as successful with the git commit hash.