Add Nix flake for Cabal-based development environment - #123
Conversation
Provide a Nix flake that sets up a GHC 9.2.8 development shell with cabal-install, HLS, and two convenience wrappers: - cabal-build: runs `cabal v2-build` in the exercises/ directory - cabal-test: runs `cabal v2-exec runhaskell <file>` in exercises/ This allows NixOS users to run exercises with Cabal without needing Stack. The existing Stack workflow is not affected. Usage: nix develop cabal-build cabal-test exercises/Set1Test.hs
Provide a Nix flake that sets up a GHC 9.2.8 development shell with cabal-install, HLS, and two convenience wrappers: - cabal-build: runs `cabal v2-build` in the exercises/ directory - cabal-test: runs `cabal v2-exec runhaskell <file>` in exercises/ This allows NixOS users to run exercises with Cabal without needing Stack. The existing Stack workflow is not affected. Usage: nix develop cabal-build cabal-test exercises/Set1Test.hs
89a17bb to
9b60e01
Compare
…RARY_PATH - Replace hardcoded nix store path with `git rev-parse --show-toplevel` to avoid read-only filesystem issue - Use realpath in cabal-test to resolve file arguments before cd - Add LD_LIBRARY_PATH for zlib to fix libz.so warning
96451b6 to
ee76451
Compare
|
While adjusting the PR, I saw some issues that already exist in the Issue ,so added a README to support the usage instructions for Cabal and Nix. |
13fd264 to
5217e0f
Compare
|
Sorry for the additional review request. I just rebased and cleaned up the commit history. The original history was a bit messy, so out of a desire for cleanliness, I cleaned it up. |
|
This looks ok. I'll try to merge this soon. Merging needs a bit of extra work since the private repository that this repository is generated from needs to be updated to match. |
Got it. |
|
You should maybe update the .gitignore to allow commiting the flake.lock file ( |
|
|
Additional change : I also removed the shellHook that attempted to auto-run cabal update . It wasn't working reliably (likely due to my misunderstanding of cabal's behavior), so I replaced it with a note in the README instead. This also slightly improves shell startup time. + Once inside the Nix shell, you can use the Cabal commands described above. **If you encounter issues with missing packages, try running `cabal update` first to refresh the Hackage index.**
The above is the main content that has been added. |
5217e0f to
8c15429
Compare
8c15429 to
b45c907
Compare


Provide a Nix flake that sets up a GHC 9.2.8 development shell with cabal-install, HLS, and two convenience wrappers:
cabal v2-buildin the exercises/ directorycabal v2-exec runhaskell <file>in exercises/This allows NixOS users to run exercises with Cabal without needing Stack. The existing Stack workflow is not affected.
Usage:
nix develop
cabal-build
cabal-test exercises/Set1Test.hs