Skip to content

Upgrade the Nix build system #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 2, 2020
Merged

Upgrade the Nix build system #639

merged 7 commits into from
Dec 2, 2020

Conversation

pepeiborra
Copy link
Collaborator

  • Switch to the haskell-updates branch, so that we get Stackage nightly packages
  • Remove the hard-coded list of packages, let cabal2nix find out
  • A Github Action to exercise the Nix script and warm up a Cachix cache

@jneira
Copy link
Member

jneira commented Dec 1, 2020

I think this one would close #122, as we would have an "official" way to install using nix.

Copy link
Collaborator

@sir4ur0n sir4ur0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks cleaner (though I'm no Nix expert)!

I have tested (with a 25 min Nix build :'( ) and this seems to work with Stack

@@ -0,0 +1,39 @@
{ sources ? import ./sources.nix }:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you guys think about adding nixfmt to shell.nix packages and use it on all Nix files? This solves all formatting concerns.

This may also help, as e.g. here the let .. in .. was not aligned and I had slight trouble understanding 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are welcome to do this, please send a PR!

```shell
$ cachix use haskell-language-server
$ nix-shell
$ cabal update
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Cabal part is unrelated to Nix, as one can use Nix with Stack. How about removing the 2 Cabal commands?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Nix script is specifically targeted at using with cabal build

The haskell-updates branch is already on Stackage nightly, which allows for a
much better cache hit rate (assuming haskell-updates is backed by a Hydra cache,
which I'm not quite sure of).
Adds support for auth tokens
@pepeiborra
Copy link
Collaborator Author

Thank you, this looks cleaner (though I'm no Nix expert)!

I have tested (with a 25 min Nix build :'( ) and this seems to work with Stack

Did you try to setup the Cachix binary cache? It should have downloaded all the artefacts for you (and stack will happily ignore them, but at least you don't have to wait for Nix)

Co-authored-by: Javier Neira  <atreyu.bbb@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants