To Dream of Magick

Dreamer Shaper Seeker Maker

A very quick update just to mention a tiny microscript that I wrote this evening.

cabal-install builds a local replica of all packages that get downloaded from Hackage (or Stackage, if you prefer). This both makes the packages installable to local sandboxes, and also obviates the need for additional downloads. So, I learned how to add on my own package repository.

This is not a primer on the overall structure of your ~/.cabal/. But a very quick relevant rundown goes like so:

~/.cabal/

bin/

lib/

logs/

packages/

hackage.haskell.org/

00-index.cache

00-index.tar

00-index.tar.backup

package folders/

savannidgerinel.com/

setup-exe-cache/

share/

config

world

So, here is your structure. Obviously, you will not have a savannidgerinel.com/ folder in yours, but the point of this is to make your own. This cache is for packages that you want installable locally, but for some reason don't want to push. In my case, it is because some of them are not polished enough, and in some cases I'm writing proprietary packages. If I were in an organization, I'd build a Hackage server and be done, but I'm a lone developer and can't be bothered with that level of setup.

To add to your new repository, first create the directory under packages/. Then, open up config, and right under remote-repo and remote-repo-cache, add local-repo like so:

local-repo: /home/savanni/.cabal/packages/savannidgerinel.com

Basically, you instantly have a local repository. But, presumably, you want to install a package and so it needs to be in your cache. Here's an example from my own system: