title: How to find the commit a Nix channel points to?
body: <p>When trying to revive old projects, sometimes I have to fish around for <a href="https://github.com/NixOS/nixpkgs/commits/" rel="nofollow noreferrer">older Nixpkgs commits</a> to get things started.</p>
  <p>For example, most of my <code>shell.nix</code> files start like this,</p>
  <pre class="lang-hs prettyprint-override"><code>{pkgs ? import &lt;nixpkgs&gt; {} }:
  
  pkgs.mkShell {
    # ...
  }
  </code></pre>
  <p>that would import all expressions from the commit where the current <a href="https://web.archive.org/web/20201111201831/https://nixos.wiki/wiki/Nix_Channels" rel="nofollow noreferrer">channel</a> points to, but after some time, there have been so many changes that my project won't build anymore; then I will have to find a commit that still works, and go from there.</p>
  <pre><code>$ nix-shell --arg pkgs \
  &gt; 'import (fetchTarball &quot;https://github.com/NixOS/nixpkgs/archive/0c0fe6d85b92c4e992e314bd6f9943413af9a309.tar.gz&quot;) {}'
  </code></pre>
  <p>It would probably be the best if I could just save the working commit from the channel at the time, and have something solid to fall back to when needed later.</p>