[Nix-dev] Haskell Infrastructure - Nix-Shell with Hoogle from cabal2nix
William Casarin
bill at casarin.me
Tue Feb 16 18:57:10 CET 2016
Hey Andreas,
On Tue, Feb 16, 2016 at 1:57 AM, Andreas Herrmann <andreash87 at gmx.ch> wrote:
> In any case, the question about a Hoogle database remains. I find it very useful in situations where I don't have a reliable Internet connection at hand. (train/plane/etc.)
wrt. the hoogle question, there's a bunch of solutions written up here:
http://stackoverflow.com/questions/27728838/using-hoogle-in-a-haskell-development-environment-on-nix
The one I use is my answer, a large nix-shell with all of the
libraries I would ever use. The second answer is project-local hoogle
db, which I personally wouldn't find that useful.
I even have a systemd service which runs the hoogle database here:
https://github.com/jb55/nix-files/blob/8a47989a1091910fdba202f7def235ddcca6b726/services/hoogle/default.nix
Which I plan on adding to nixpkgs soon.
> To avoid any collisions I've developed a habit of keeping as many things as possible in separate nix-shells rather than in my user profile
The way I do this is create a custom environment for my haskell tools like so:
https://github.com/jb55/nix-files/blob/8a47989a1091910fdba202f7def235ddcca6b726/nixpkgs/config.nix#L62-L77
and
https://github.com/jb55/nix-files/blob/8a47989a1091910fdba202f7def235ddcca6b726/nixpkgs/config.nix#L43-L46
Then I can just nix-env -i haskellTools to put it in my path, and
nix-env -e haskellTools to
remove it from my path when I'm done. You could even automate this
with a script.
Cheers,
William
More information about the nix-dev
mailing list