cabal2nix in git, and other questions - Nix

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Magnus Therning

You check in files generated by cabal2nix too?

Sridhar Ratnakumar

cabal2nix? That's old school. Don't use it. developPackage succeeds it (it uses callCabal2nix underneath).

Magnus Therning

Sure, but where do I found out stuff like that?
The only docs I've read so far are Gabriel's and yours.

Magnus Therning

Maybe the most pressing issue right now is how the f**k do I get nix-shell to start my choice of shell? :grinning_face_with_smiling_eyes:

Sridhar Ratnakumar

Ya, docs on nix mostly suck. It is one of the reasons I wanted to write that article, as a common easy starting point for Haskellers. A lot of learning, beyond that, happens by trial and error, reading other people's code, etc.

Sridhar Ratnakumar

Maybe the most pressing issue right now is how the f**k do I get nix-shell to start my choice of shell? :grinning_face_with_smiling_eyes:

Try nix-shell . --command fish

Magnus Therning

Hmm, no way of avoiding having to pass the shell explicitly all the time?
No way to get nix-shell to honour $SHELL?

Sridhar Ratnakumar

Not sure. I don't stay long in nix-shell to bother finding anyway. :-) Usually I do one-off runs with nix-shell --run

Sridhar Ratnakumar

Typically that's either nix-shell --run ghcid or nix-shell --run 'cabal new-repl'

Magnus Therning

Yes, good point, I'll have to see what patterns emerge as I drink the Nix koolaid I guess.

Sridhar Ratnakumar

I very often use nix-shell --run even to run non-Haskell programs. Like nix-shell -p tree --run 'tree -d'. I don't even bother installing the package.

Magnus Therning

You don't happen to have any pointer to any documentation on how I can control the build when using pkgs.haskellPackages.developPackage?
For instance I have no use for profiling or docs at the moment.

Sridhar Ratnakumar

Use dontHaddock (similar to dontCheck for disabling unit tests). I think for profiling it is disableLibraryProfiling and disableExecutableProfiling. cf. https://github.com/srid/rib/blob/master/default.nix#L40-L45

Haskell library for writing your own static site generator - srid/rib
Magnus Therning

I'm not really sure how/where to set dontHaddock though...