Haskell in Nixpkgs/NixOS | 719 Members | |
| For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | 144 Servers |
| Sender | Message | Time |
|---|---|---|
| 27 Mar 2025 | ||
| But I don’t think there is any progress being made because no one has time for it. | 12:34:32 | |
| * But I don’t think there is any progress being made because no one has time for it, currently. | 12:34:40 | |
| I will try to get to it. | 12:40:33 | |
| what's the good-to-go signal? I am looking at https://github.com/cdepillabout/nix-haskell-updates-status | 12:42:33 | |
| """
""" I guess this is the no-go reason? | 12:43:02 | |
| Yes | 12:46:51 | |
| 28 Mar 2025 | ||
| 17:46:26 | ||
| 22:51:53 | ||
| 30 Mar 2025 | ||
| I'm currently doing Exercism's Haskell exercises. They use stack (lts-20.18) for setting up dependencies etc. What's the best way to integrate it with Nix? If it's possible I simple want some tool that automatically download and install the correct version of GHC, HLS, and the dependencies for the project | 15:54:45 | |
| Each Exercise is small, so I want to do minimal amount of time and space to setup the toolchain for that exercise. | 15:56:07 | |
| If I'd GHCUp it looks like it would work flawlessly, but from what I gather it doesn't work on NixOS? | 15:59:38 | |
In reply to @a12l:matrix.org Unless it does something special on NixOS (I know modern Stack does), the GHC binaries that ghcup downloads are almost certainly dynamically linked and for that reason alone will not work. Only fully statically linked executables work as-is on NixOS because they don't hardcode assumptions about how files are organised on the host. GHC does more though: it needs to execute a C compiler and AFAIK that compiler cannot live in the same executable. Most NixOS systems don't have any C compiler installed in an easy-to-find location. | 16:50:53 | |
In reply to @a12l:matrix.org Have you tried using Stack on NixOS? It might just work. I'm not sure. You should get Stack from Nixpkgs, not from ghcup. | 16:52:47 | |
| My current setup is having added
in my NixOS config. When I run the tests by executing But from what I understand, I've HLS compiled against my globally installed GHC version (9.6) instead of the one used in the project (9.2). Not 100 percent sure about that. Does HLS need to be specified in some stack file for it to installed? | 17:35:18 | |
I don't know about Stack's ability to pull HLS, but you can override the HLS package to enable other compiler versions. | 17:36:25 | |
| It's possible, but not straightforward. To have to add the right version of hls to the nix shell that stack automatically uses on nixos | 19:22:35 | |
| * It's possible, but not straightforward. You have to add the right version of hls to the nix shell that stack automatically uses on nixos | 19:22:47 | |
| Not really. You can just enable all versions and I think the wrapper should pick the right version? | 19:37:06 | |
| Mmh first of all, what I said was wrong because stack's nix shell won't help when it comes to enabling hls for an editor | 19:47:58 | |
| 31 Mar 2025 | ||
I want to run doctest in the checkPhase of a derivation created by cabal2nix. I think I’m close. But, I can’t figure out how to get the GHC environment that’s used to build the package. I.e., doctest is complaining it can’t find the dependencies of the package I’m trying to test. Like command -v ghc in checkPhase is giving me a path like “/nix/store/xxx-ghc-9.6.6/bin/ghc” when I’m looking for something more like “/nix/store/xxx-ghc-9.6.6-with-packages/bin/ghc”. | 06:59:00 | |
| When I replace
I get this error when trying
| 09:40:28 | |
| No errors when I use
Unsure about the difference between | 09:43:09 | |
But when I use overrideAttrs it doesn't seem that it installs HLS for 9.2 | 09:43:35 | |
I think there is quite a few packages in nixpkgs that use doctest. The I know off the top of my head is termonad, which uses cabal-doctest. Maybe you could look at exactly what cabal-doctest is doing, and try to emulate it within your derivation? | 11:33:19 | |
| a12l: Are you sure the "No space left on device" is not a problem with your system? | 11:36:40 | |
| It makes sense because the build get’s bigger with the overrides that you mention. | 11:37:00 | |
| Yeah, overrideAttrs is wrong and doesn’t even throw an error, so it is a no-op. | 11:38:10 | |
| Is it possible my /tmp (tmpfs) that gets filled? For I've > 75GB left on my SSD, and I hope more than that isn't necessary? | 11:38:24 | |
| I guess so. | 11:39:21 | |
| Guess I'll have to move my /tmp to my regular fs. I'll come back later today with the results :) | 11:44:00 | |