Recently had some trouble with nix. I was trying to write a Haskell ffi wrap around the micro-ecc lib. After doing this successfully, I wanted my library to work if micro-ecc was correctly installed somewhere on your system. I had the following two directories:
$ ls
micro-ecc
hs-micro-ecc
In micro-ecc I had a fairly vanilla nix expression that looked like: