Skip to content

Instantly share code, notes, and snippets.

@ScottFreeCode
Last active July 26, 2023 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScottFreeCode/9b0ea3e52fa56c93ea8ca14791e55bb4 to your computer and use it in GitHub Desktop.
Save ScottFreeCode/9b0ea3e52fa56c93ea8ca14791e55bb4 to your computer and use it in GitHub Desktop.
Nix+Haskell Examples Collection

About

Here are some gists that demonstrate how to wrap a Haskell project with Nix, without changing the Haskell.

A handful of cases are covered:

  • simple package
  • package with custom Setup and external helper programs
  • a repository/project containing multiple packages

How to Use

For the most part, you just have to copy the .nix files into your project and add the .gitignore content.

If you need a how-to, these should also serve as a minimal example you can imitate for any of the more complex cases.

Caveat

(I’m not 100% certain that the monorepo ones shouldn’t be configured somehow to pull in all the same .gitignore content that git itself would, e.g. system and user files, instead of just the local one and having to put e.g. backup syntax or other stuff in there that would normally go at the system level.)

Bugs (not in these, in Cabal/Nix)

There are a couple interesting issues uncovered here, though, that you should be able to use these as minimal complete reproductions for.

Links/Gists

Here’s the list:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment