haskell.nix icon indicating copy to clipboard operation
haskell.nix copied to clipboard

Example nix files in the user guide contain syntax errors

Open kaldonir opened this issue 4 years ago • 3 comments

The example nix files in the user guide which show how to use haskell.nix with stack/cabal projects contain syntax errors.

In particular, the commented modules block doesn't work, because it contains attribute set elements in a list:

{
    modules = [
      # Specific package overrides would go here for example:
      packages.cbors.package.ghcOptions = "-Werror";
      packages.cbors.patches = [ ./one.patch ];
      packages.cbors.flags.optimize-gmp = false;
      # It may be better to set flags in `cabal.project` instead
      # (`plan-to-nix` will include them as defaults).
    ];
}

As a piggy-back issue: It's pretty unclear to me what the modules list can be used for, especially because the disclaimer states a better way to set such flags.

kaldonir avatar Jan 10 '20 14:01 kaldonir

@kaldonir ohh. That's missing the curly braces :( It should be modules = [{ ... }].

In general you can juse all kinds of options you'd like to change. The disclaimber is must supposed to be a suggestion. Ideally you only have one single source of truth, and if you use a cabal project (or stack project), the cabal.project or stack.yaml file should be authoritive and haskell.nix should just do as the respective authoritive files say. If however you want to deviate from that (or not want to use callStack/CabalProject functions) for your ci, you can do all the customizations in modules.

angerman avatar Jan 13 '20 05:01 angerman

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 28 '22 23:09 stale[bot]

Hopefully this sort of thing will be fixed by #1714

hamishmack avatar Oct 01 '22 05:10 hamishmack

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 29 '23 05:01 stale[bot]