13 Oct 2024 |
hellwolf | * I was trying to browse docs locally, in case I don't have internet. I would like to host a local static server for those files at `http://ghc-docs.localhost/{latest,ghc910,...}' | 18:56:26 |
hellwolf | Or even better... have your own hoogle instance. Lately the public hoogle is quite unreliable and slow.
I think it would help the infra that if we NixOS people can self-host and share the burden by decentralizing it. | 18:57:49 |
maralorn | In reply to @hellwolf:matrix.org I was trying to browse docs locally, in case I don't have internet. I would like to host a local static server for those files at `http://ghc-docs.localhost/{latest,ghc910,...}' Are wa talking about the ghc user guide? | 18:58:04 |
maralorn | In reply to @hellwolf:matrix.org Or even better... have your own hoogle instance. Lately the public hoogle is quite unreliable and slow.
I think it would help the infra that if we NixOS people can self-host and share the burden by decentralizing it. Uh, that’s pretty easy. | 18:58:25 |
hellwolf |
The User's Guide
The User's Guide has all you need to know about using GHC: command line options, language extensions, GHCi, etc.
Libraries
Documentation for the libraries that come with GHC.
GHC API
Documentation for the GHC API.
| 18:58:44 |
maralorn | https://code.maralorn.de/maralorn/config/src/commit/6d3f843360da71e73f30985d50d1bf97ce80b9d0/home-manager/roles/clients/haskell-env.nix#L3 | 18:59:06 |
hellwolf | In reply to @maralorn:maralorn.de Uh, that’s pretty easy. that's good to hear.... any nixos configuration to share? | 18:59:07 |
hellwolf | thanks! | 18:59:27 |
maralorn | Technically a home manager configuration but you will be able to adapt it. | 18:59:38 |
maralorn | Ah, and the ghcWithPackages is something I define in another file via ghc.withHoogle (p: ...) | 19:00:18 |
hellwolf | That indexes packages you have installed? | 19:00:22 |
maralorn | More or less, yes. | 19:01:23 |
maralorn | It indexes all packages (and their dependencies) which I passed into that withHoogle call. | 19:01:48 |
maralorn | Since I also install that ghcWithPackages to my environment I have a hoogle which exactly reflects the provided packages. | 19:02:29 |
hellwolf | neat | 19:03:33 |
alexfmpe | I just do
shellFor { withHoogle = True; ...} | 19:09:50 |
alexfmpe | For project specific hoogle | 19:10:34 |
alexfmpe | Then
hoogle server --local -p 8080 | 19:10:38 |
14 Oct 2024 |
| m1-s joined the room. | 09:40:24 |
m1-s | Hi, how can I translate the command cabal test --test-options="--fail-on-focused" into nix? So far I have tried including this flag in the cabal file but this is not supported by cabal. Do I have to override the test phase of the nix derivation? | 09:43:21 |
m1-s | I guess I can set the env variable HSPEC_OPTIONS for now. Hspec docs say that this is deprecated and will be removed in the future. | 10:20:48 |
jean-paul. | is there a way to get a callCabal2nix derivation to build all of the tests for a package, in addition to the exes, and include them in the output? | 10:35:14 |
maralorn | In reply to @m1-s:matrix.org Hi, how can I translate the command cabal test --test-options="--fail-on-focused" into nix? So far I have tried including this flag in the cabal file but this is not supported by cabal. Do I have to override the test phase of the nix derivation? I think there is a parameter to pass arguments to the test call in our mkDerivation function. | 10:40:54 |
maralorn | In reply to @jean-paul.:matrix.org is there a way to get a callCabal2nix derivation to build all of the tests for a package, in addition to the exes, and include them in the output? Well, it already does build them. You probably only need insert a copy statement in the install phase to get them into the output. | 10:41:43 |
jean-paul. | In reply to @maralorn:maralorn.de Well, it already does build them. You probably only need insert a copy statement in the install phase to get them into the output. Ah, yes, I guess I might see how that could work. I'll try it out, thanks. | 11:59:15 |
hellwolf | how should I think about this: I am setting up CI for a project, I'd like to test it against different versions of ghc, but I am facing the choices of testing against the latest hackage set through cabal directly or nixokgs or both. and I didn't even include the stackage... | 16:07:39 |
maralorn | I actually never had a setup like this. But I would actually do this with plain cabal-install, maybe just installing system deps and ghc with nix. (nix is nice for devshells and deployments but not so nice for enumerating tons of different test setups. Then if you want to test certain library combinations I would sprinkle in version constraints or even a whole stackage snapshot via cabal.project. | 16:18:15 |
hellwolf | so... then what is the proper purpose of Haskell Nix project, other than using the haskell executable leaf packages? | 16:40:01 |
maralorn | I mean, there is not really a basis to argue teleologically here. 😄 I think the more relevant question is what it is good at. But our priorities are 1) building Haskell programs for nixos users 2) providing Haskell dev environments via Nix.
May stance is generally that I would always deploy everything with Nix and only test what I deploy, which in implies testing also only happens with Nix.
But if you develop a library for hackage then it makes sense to test it how users will use it, which is probably not with Nix. | 16:58:11 |
maralorn | * I mean, there is not really a basis to argue teleologically here. 😄 I think the more relevant question is what it is good at. But our priorities are 1) building Haskell programs for nixos users 2) providing Haskell dev environments via Nix.
My stance is generally that I would always deploy everything with Nix and only test what I deploy, which in implies testing also only happens with Nix.
But if you develop a library for hackage then it makes sense to test it how users will use it, which is probably not with Nix. | 16:58:29 |