[Nix-dev] How to develop with chicken and emacs

Ertugrul Söylemez ertesx at gmx.de
Sun Apr 19 00:45:20 CEST 2015


Hi there Eike,

> I found out about the egg2nix program and saw, that the
> 'chicken-eggs.nix' file contains many eggs and that the egg2nix
> program uses it. So, right now I'm starting a shell like this
>
>     nix-shell -p egg2nix
>
> This drops me in a shell, where the eggs are setup via
> CHICKEN_REPOSITORY_EXTRA and CHICKEN_INCLUDE_PATH. That's a step
> forward, but it still feels strange. Maybe just because I'm not used
> to it… Is this a recommended way for developing? (I probably should
> create my own nix file to make this env I guess)

My experience with Chicken is limited, but what you are describing
sounds about right.  It is indeed the way we develop software with the
help of Nix.  In Haskell land cabal2nix generates both an expression for
your project and a (separate) expression that drops you into a shell
with all the dependencies in scope.


> But the real problem is, that my emacs doesn't know about this
> environment. I don't know how to handle this (besides starting a new
> emacs from the nix-shell shell, which I don't want).

The way I do this is to fire up a Makefile from Emacs.  The Makefile
uses nix-shell to start the actual builder:

    nix-shell --pure --command "./Setup build"

This is an indirection, but it makes sure that the environment the
builder sees is (fairly close to) the environment the build script would
see when you use nix-build.  And indeed, you can actually use nix-build
as well, although you probably don't want to, because it rebuilds the
whole thing all the time.

I hope this helps.


Greets,
Ertugrul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150419/2db72ece/attachment-0001.bin 


More information about the nix-dev mailing list