!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

720 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org143 Servers

Load older messages


SenderMessageTime
19 Aug 2025
@alexfmpe:matrix.orgalexfmpehttps://github.com/NixOS/ofborg?tab=readme-ov-file#automatic-building16:42:40
20 Aug 2025
@kephaspierre:matrix.orgPierre Thierry I've looked at documentation and source code but I don't see how I can use developPackage and add additional packages to the environment (ideally they would only be added when using a shell). I guess that's done with the modifier attribute? 18:02:08
@kephaspierre:matrix.orgPierre Thierry(I'd like to add packages like HLS and hlint)18:02:32
@artem.types:matrix.orgArtemhow do I get a sense of when the GHC 9.10 bump will be merged into staging? I saw a long list of failures but surely not everything has to be fixed before the merge. I also saw "We only do the merge if the mergeable job is succeeding on hydra" but how do I get a sense of close it is to succeeding?19:39:21
@maralorn:maralorn.demaralorn Artem: I am not sure anyone has it. We probably want to fix most of the errors here before merging: https://github.com/cdepillabout/nix-haskell-updates-status 20:04:11
@maralorn:maralorn.demaralornLast ghc bump took 4 to 5 months. But that was the worst one I can remember. We normally aim at one month and two are realistic.20:04:13
23 Aug 2025
@magthe:tchncs.deMagnus
In reply to @kephaspierre:matrix.org
I've looked at documentation and source code but I don't see how I can use developPackage and add additional packages to the environment (ideally they would only be added when using a shell). I guess that's done with the modifier attribute?
This is how I do it. At least at the moment, things change as I learn more Nix.
https://gitlab.com/magus/nix-setups/-/tree/main/hs-shell?ref_type=heads
15:34:30
@sternenseemann:systemli.orgsterni (he/him)Eval with Stackage LTS 24.6 https://hydra.nixos.org/eval/1817909?compare=181789622:01:32
@kephaspierre:matrix.orgPierre Thierry
In reply to @magthe:tchncs.de
This is how I do it. At least at the moment, things change as I learn more Nix.
https://gitlab.com/magus/nix-setups/-/tree/main/hs-shell?ref_type=heads
I finally found a way where I wrote the least possible amount in my shell.nix, I do import project.nix (I run cabal2nix . > project.nix when my cabal file changes), and I use builtins.functionArgs to see every package I need, and use that in a pkgs.mkShell { packages = [ pkgs.hlint pkgs.haskell-language-server (pkgs.haskellPackages.ghcWithPackages getDeps)]
23:26:40
24 Aug 2025
@sternenseemann:systemli.orgsterni (he/him) if you have the generated file you can just use haskell.packages.${your-pkg-set}.shellFor { packages = p: [ (p.callPackage ./project.nix { }) ]; nativeBuildInputs = [ /* other tools */ ]; }. 14:10:00
@dandart:matrix.orgUraraka ~ OchacoI no longer use nix for haskell packages, they're always out of date with hackage, so I just have my shell.nix including the correct ghc and cabal and then use cabal for the rest14:34:34
@ashinnv:matrix.orgMagnolia Mayhem changed their profile picture.19:10:01
@ashinnv:matrix.orgMagnolia Mayhem changed their profile picture.23:20:56
@ashinnv:matrix.orgMagnolia Mayhem changed their profile picture.23:24:20
25 Aug 2025
@ashinnv:matrix.orgMagnolia Mayhem changed their profile picture.03:00:52
@ashinnv:matrix.orgMagnolia Mayhem changed their profile picture.03:01:08
@ashinnv:matrix.orgMagnolia Mayhem changed their profile picture.03:01:29
@morgan.arnold:matrix.orgmra joined the room.07:25:22
@morgan.arnold:matrix.orgmra Howdy! Having some issues trying to set up a flake for development. I'm trying to use Clash to do FPGA stuff. The authors of Clash provide this starter template: https://github.com/clash-lang/clash-starters/tree/main/simple-nix, but I wanted to try to make a flake, thinking that it would be simpler to simply define a package, and then use nix develop to obtain a dev environment. I wrote this flake: https://paste.rs/guCkG.txt and just replaced all of the .nix files with this. It seems to work, but when I attempt to run the clash executable, I get a weird error: "<command line>: Could not find module ‘GHC.TypeLits.KnownNat.Solver’.". I can't figure out what causes this, and it doesn't happen when I run nix-develop in the root of the template as given, which is strange, since in both cases the build is just using runCabal2nix, rather than explicitly including this GHC plugin as a build input explicitly. 07:29:35
@maralorn:maralorn.demaralorn @morgan.arnold:matrix.org One theory would be, that your flake is picking a different nixpkgs version. The template seems to be pinned to a known good version. 07:51:34
@morgan.arnold:matrix.orgmra oh, that's bizarre. somehow didn't notice all of the weirdness in the nix/ directory... is there a straightforward way of copying over the nix/ directory and then using that as the nixpkgs input for my flake? that seems like the simplest way to ensure that the versions are all good 08:29:59
@kephaspierre:matrix.orgPierre ThierryI'll try that, that's way simpler than anything already shown as example for `shellFor`!10:36:26
@maralorn:maralorn.demaralorn mra: the nixpkgs pin in the nix/ dir should have a commit hash somewhere. You can put that commit hash in the nixpkgs input in the flake. (see nix manual for syntax) 10:36:53
@sternenseemann:systemli.orgsterni (he/him) An alternative is to use callCabal2nix in the packages function which would generate the expression on the fly. (Basically like developPackage, but developPackage would, I think, not work since it behaves differently depending on whether the IN_NIX_SHELL environment variable is set.) 11:36:33
@sternenseemann:systemli.orgsterni (he/him)Pitching the idea to target an upgrade to 9.10.3: https://discourse.nixos.org/t/call-for-contributions-we-are-updating-to-ghc-9-10-2/67756/411:37:36
@teoc:matrix.orgTeo (he/him)That's a good call IMO. There's a pretty annoying in 9.10.2 where GHC will panic if you use a constructor you havent imported but you've imported the synonymous type11:41:56
@alexfmpe:matrix.orgalexfmpewow text 2.1.2 is the gift that keeps on giving13:05:58
@dandart:matrix.orgUraraka ~ Ochaco
In reply to @alexfmpe:matrix.org
wow text 2.1.2 is the gift that keeps on giving
Isn't it just? I use T.show now. I had to change around and not use nix for packages and just use hackage because it wasn't in nix for ages
13:13:36
@maralorn:maralorn.demaralornIt is a very simple change, yes. But we nix maintainers need to wait for it to propagate through every package in the ecosystem to adopt it. And that is one of the many reasons that we can't deliver the deployment speed that you apparently expect.13:57:51
@kephaspierre:matrix.orgPierre Thierry Damnit, all this time, I hadn't see that someone had already added an example of how to add build tools with developPackages… It wasn't there the first time I read that page and I didn't spot the addition. 15:05:13

Show newer messages


Back to Room ListRoom Version: 6