[Nix-dev] Setting an environment variable in "extraCmds"

Alfredo Di Napoli alfredo.dinapoli at gmail.com
Sat May 17 09:16:27 CEST 2014


Hi there,

> 
> I'm unsure why you're using extraCmds at all here. Why is it necessary
> to use the stuff from your ~/.cabal ?

The rationale is that I want to still have a user installed ghc-mod I can call, either in a plain sandbox or within a cabal sandbox. Being on a mac, ghc-mod is unfeasible to install via nix.
But this is kinda tangential, the problem I'm trying to solve here is to set an env variable.

> 
> For reference, I just did something like this recently. See [1] for a
> default.nix in which I can build GHC. I can not vouch for running
> validate (for example, nix-shell resets LANG to ‘C’ which screws up the
> tests) but it should work for building. Make sure to fix up the paths in
> it, I use absolute ones so I can ln -s to it without troubles.
> 
> It does not use myEnvFun however, I have not looked into that kind of
> setup yet. I think John Wiegley has a setup you might want to look at too.

Thanks for your reference, I'll see if I can any info out of it. I saw John's config.nix,
And mine was inspired to it, but I still have no clue about why my commands gets ignored if I put them inside "extraCmds". 

Thanks,
Alfredo


More information about the nix-dev mailing list