ssm-lang / sslang

A language built atop the Sparse Synchronous Model
BSD 3-Clause "New" or "Revised" License
18 stars 0 forks source link

Non-invasive Nix + Nix Flake dev shell support #106

Closed leoqiao18 closed 2 years ago

leoqiao18 commented 2 years ago

Stack and Nix have overlapping responsiblities when it comes to package management. Although Stack has the ability to integrate with Nix, I believe that it is not good to change the Stack configurations just to make this play well with Nix on Nix/NixOS systems.

It turns out that Tweag had a post that discusses this, providing a solution that integrates stack and nix in a "smooth and non-invasive" way. For more information, read the blog. In order to have more explicit version pinning, this PR is using a version that extends on the idea in the blog and make use of Nix Flake. This is taken from a section in Stack's documentation.

In the future, the only maintenance needed for this is to sync the GHC version in flake.nix with the GHC version for the resolver being used in Stack.

For those on NixOS or systems with Nix that have Flake enabled, you can drop into the nix development shell using either nix develop or nix-shell. This also allows users to use nix-direnv. However, when I tested with lorri, it runs into some error... I'll investigate into this later.

Recall that I was having trouble accessing the regression tests when executing stack test. This PR fixes that issue as well! So this is important for at least me...

j-hui commented 2 years ago

@LeoQiao18 while you're at it, could you also make a GitHub action that runs the regression test suite using NixOS?