Thanks for the help - Nix

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

Magnus Therning

Thanks @Sridhar Ratnakumar , @Jack Henahan , and @Ben Kolera for the help.
My expression for building looks like this at the moment:

let
  p = import <nixpkgs> {};
  t = p.lib.trivial;
  hl = p.haskell.lib;

  shell-pkgs = with p.haskellPackages;
    [cabal-install
     ghcid];
  build-pkgs = [];

  extra-pkgs = if p.lib.inNixShell
               then shell-pkgs
               else build-pkgs;

  addTools = (t.flip hl.addBuildTools) extra-pkgs;

in
  p.haskellPackages.developPackage {
    root = ./.;

    modifier = (t.flip t.pipe)
      [addTools
       hl.dontHaddock
       hl.disableLibraryProfiling
       hl.disableExecutableProfiling];
  }
Jack Henahan

Might have to steal bits of that, tbh

Sridhar Ratnakumar

I like putting them in one place:

  modifier =
    let
      addExtraDeps =
        (t.flip h.addBuildTools) (with haskellPackages;
          [ cabal-install
            ghcid
          ]);
    in (t.flip t.pipe) [
      addExtraDeps
      h.dontHaddock
    ];