This adds an alternative way to develop the project using cabal-install by using Nix to manage the Cabal packages and their (not necessarily Haskell-only) dependencies.
Now it should be possible to simply enter a nix-shell in the project root and start building/testing the project with the cabal and ghc executables it provides. I've pinned nixpkgs to a commit that is known to work for us at Active Group and that contains GHC 8.10.4.
The ConCat packages are provided as a nixpkgs overlay (./nix/concat-overlay.nix) so that anyone who would want to use them can simply import the Nix expression and use the resulting overlay themselves. (This is also the main motivation for this PR as we're currently maintaining Nix expressions for the packages separately in our project; having them close to the source would enable us to use them for ConCat as well as for our own project).
Note: The cabal.project file contains relative paths to git checkouts of vector-sized and netlist/netlist-to-verilog/etc. For the nix-based development setup these are irrelevant as I've included the necessary packages in the pkgs.haskellPackages set. The version of vector-sized seemed to be recent enough for it to just work.
It's also possible to use nix-build to build any ConCat package, like this: nix-build nix/pkgs.nix -A haskellPackages.concat-known. But note that nix-build by default also runs the test suites, and concat-examples (for instance) fails.
This adds an alternative way to develop the project using
cabal-install
by using Nix to manage the Cabal packages and their (not necessarily Haskell-only) dependencies.Now it should be possible to simply enter a
nix-shell
in the project root and start building/testing the project with thecabal
andghc
executables it provides. I've pinnednixpkgs
to a commit that is known to work for us at Active Group and that contains GHC 8.10.4.The ConCat packages are provided as a nixpkgs overlay (
./nix/concat-overlay.nix
) so that anyone who would want to use them can simply import the Nix expression and use the resulting overlay themselves. (This is also the main motivation for this PR as we're currently maintaining Nix expressions for the packages separately in our project; having them close to the source would enable us to use them for ConCat as well as for our own project).Note: The
cabal.project
file contains relative paths to git checkouts ofvector-sized
andnetlist
/netlist-to-verilog
/etc. For the nix-based development setup these are irrelevant as I've included the necessary packages in thepkgs.haskellPackages
set. The version ofvector-sized
seemed to be recent enough for it to just work.It's also possible to use
nix-build
to build any ConCat package, like this:nix-build nix/pkgs.nix -A haskellPackages.concat-known
. But note thatnix-build
by default also runs the test suites, andconcat-examples
(for instance) fails.