title: Why does Haskell Stack keep downloading the same stuff?
body: <p>(In case it’s relevant, I use NixOS. Here’s <a href="https://github.com/JeffreyBenjaminBrown/nixos-experiments/blob/0f6155dfdf65e3b08d5439c5ffb3e17a8380cd64/configuration.nix" rel="nofollow noreferrer">my NixOS config</a>.)</p>
  <p>Each time I restart my computer, the first time I run stack ghci in a project, my system has had to download a ton of stuff. For instance, <a href="https://github.com/JeffreyBenjaminBrown/montevideo" rel="nofollow noreferrer">my project montevideo</a> just now started like this:</p>
  <pre><code>[jeff@jbb-dell:~/code/music/montevideo]$ stack ghci --ghci-options -Wall
  these paths will be fetched (0.47 MiB download, 1.28 MiB unpacked):
    /nix/store/k21l8caw5y607f69vvysvj5p8wcpjmb0-glpk-4.65
    /nix/store/ykbr9ci7l3qmvj6l3i68z6a8r3j5pkbf-pcre-8.44-dev
    /nix/store/z5i9b7dxg5k5hmyspa5kdaj1c7j33zlq-pcre-8.44-bin
  copying path '/nix/store/k21l8caw5y607f69vvysvj5p8wcpjmb0-glpk-4.65' from 'https://cache.nixos.org'...
  copying path '/nix/store/z5i9b7dxg5k5hmyspa5kdaj1c7j33zlq-pcre-8.44-bin' from 'https://cache.nixos.org'...
  copying path '/nix/store/ykbr9ci7l3qmvj6l3i68z6a8r3j5pkbf-pcre-8.44-dev' from 'https://cache.nixos.rg'...
  Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail
  Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
  Cabal file warning in/home/jeff/code/music/montevideo/montevideo-monome/montevideo-monome.cabal@0:0: A package using secti
  on syntax must specify at least
  'cabal-version: &gt;= 1.2'.
  Decimal             &gt; configure
  Decimal             &gt; Configuring Decimal-0.5.1...
  Decimal             &gt; build
  NumInstances        &gt; configure
  Decimal             &gt; Preprocessing library for Decimal-0.5.1..
  Decimal             &gt; Building library for Decimal-0.5.1..
  Decimal             &gt; [1 of 1] Compiling Data.Decimal
  NumInstances        &gt; Configuring NumInstances-1.4...
  NumInstances        &gt; Warning: 'ghc-prof-options: -prof' is not necessary and will lead to problems
  NumInstances        &gt; when used on a library. Use the configure flag --enable-library-profiling
  NumInstances        &gt; and/or --enable-profiling.
  NumInstances        &gt; build
  StateVar            &gt; configure
  NumInstances        &gt; Preprocessing library for NumInstances-1.4..
  NumInstances        &gt; Building library for NumInstances-1.4..
  NumInstances        &gt; [1 of 5] Compiling Data.NumInstances.PreRequisites
  NumInstances        &gt; [2 of 5] Compiling Data.NumInstances.Function
  ...
  </code></pre>
  <p>It takes at least 5 minutes for most projects. Each project requires a separate download.</p>
  <p>After that first download, I can start and stop GHCI in the project all I want, without having to re-download. But when I restart the machine, I need to download the libraries for each project separately all over again.</p>