title: How to `nix-build` again a built store path?
body: <p>I create my own repository to fetch some git source.</p>
  
  <pre><code># packages.nix
  with (import &lt;nixpkgs&gt; {});
  
  rec {
    rustcSource = fetchgit {
      url = https://github.com/rust-lang/rust;
      rev = "3191fbae9da539442351f883bdabcad0d72efcb6";
      sha256 = "0w1l14kz9kxyj5dw3w9xxk1fzww5xqs3sf8saay0mh7nkmvrdb59";
    };
  }
  </code></pre>
  
  <p>Then I build <code>rustcSource</code>,</p>
  
  <pre><code>sudo nix-env -f package.nix -A rustcSource
  </code></pre>
  
  <p>It reveals a store path of <code>/nix/store/096fpy9qjbz5r14aadjnq9d2md9ql9cg-rust-3191fba</code>. The problem is, I forgot to download it's submodules, so I change my expression to include submodules,</p>
  
  <pre><code>with (import &lt;nixpkgs&gt; {});
  
  rec {
    rustcSource = fetchgit {
      url = https://github.com/rust-lang/rust;
      rev = "3191fbae9da539442351f883bdabcad0d72efcb6";
      sha256 = "0w1l14kz9kxyj5dw3w9xxk1fzww5xqs3sf8saay0mh7nkmvrdb59";
      leaveDotGit = true;
      fetchSubmodules = true;
    };
  }
  </code></pre>
  
  <p>But, I discovered that <code>nix-build</code> doesn't recalculate the hash and see that the path has been built. So, it ends up not downloading the submodules.</p>
  
  <p><strong>Q: Is it nix bug? How can I "rebuild" or redownloading the repository?</strong></p>
  
  <p>P.S. Actually I create a derivation with fetchgit in it, but it fails because the submodules doesn't being downloaded. So, the above case simplify my problem.</p>