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...
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
ornix-shell
. This also allows users to usenix-direnv
. However, when I tested withlorri
, 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...