!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

723 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.org144 Servers

Load older messages


SenderMessageTime
24 Jan 2025
@hellwolf:matrix.orghellwolfhttps://github.com/NixOS/nixpkgs/pull/376526/files22:20:34
25 Jan 2025
@hellwolf:matrix.orghellwolfwhen I use haskellPackages.mkDerivation, I can't override nativeBuildInputs, where I want to add makeWrapper12:22:31
@hellwolf:matrix.orghellwolfwhat's the best practice you recommend me to do here?12:22:41
@hellwolf:matrix.orghellwolfI could wrap the derivation in another std derivation where I do wrapProgram. But I am not sure if that's the best approach.12:23:06
@hellwolf:matrix.orghellwolf

looking into pkgs/development/haskell-modules/generic-builder.nix, it seems to me this is the best way:

  executableToolDepends = [
    makeWrapper
  ];
12:26:43
@hellwolf:matrix.orghellwolf *

looking into pkgs/development/haskell-modules/generic-builder.nix, it seems to me this is the best way:

  executableToolDepends = [
    makeWrapper
  ];

Then I can do wrapProgram in postInstall

12:27:05
@collinarnett:matrix.orgCollin ArnettThis might be a really dumb idea but I was wondering what the best way would be to go about calling a nix flake from haskell. I have a test suite that requires some rather large files that are needed for testing and I would like the lifecycle of those files to be managed by nix. Ideally, the haskell code could resolve the path of the files I'm looking for during the test and nix could handle the evaluation if necessary. Nix managing these filles would be far nicer than haskell or manual management since if the file does not exist it can be fetched and stored lazily, only being cleaned up on GC. The most bruteforce and straight forward way of doing this would be to drive the nix command to build the target, then parse the nix output for the resulting path. Is there some haskell package that has a better orchestration interface for Nix like I'm describing, should I just move forward with bruteforce method or is there some sort of really obvious way of doing what I'm asking?23:38:25
26 Jan 2025
@collinarnett:matrix.orgCollin ArnettThis seems pretty nice https://hackage.haskell.org/package/hercules-ci-cnix-expr although undocumented. 00:25:52
@vigress9:matrix.org@vigress9:matrix.org changed their profile picture.05:04:59
@vigress9:matrix.org@vigress9:matrix.org removed their profile picture.05:05:05
@maralorn:maralorn.demaralorn @collinarnett:matrix.org I would pass in the files via environment variable and set that variable in the nix derivation for the testPhase and in the nix shell. 09:56:46
@lambdatheultimatealias:matrix.orglambdatheultimatealias I have a package that depends on amazonka-core which is broken on haskell-updates now. I know cachix has the same problem. Do I need to do anything? Is there a plan for amazonka-core? 14:15:27
@collinarnett:matrix.orgCollin ArnettYeah I guess that makes sense. I think it would be really cool if Nix was more like a library I could call rather than wrapping everything in Nix.14:56:12
@maralorn:maralorn.demaralorn Collin Arnett: I hear that a lot. 15:11:15
@sternenseemann:systemli.orgsterni (he/him) lambdatheultimatealias: there are no concrete plans, no. We'd appreciate if someone could look into amazonka. 15:35:47
@lambdatheultimatealias:matrix.orglambdatheultimatealias sterni: Ok. It appears somebody else got there first. I don't know if it built yet. Hopefully this does the trick!
https://github.com/mpscholten/nixpkgs/commit/c1cfff548f951e57f09a9e32cc4bc7e1048429e3
17:18:00
@quentinlg:matrix.orgQuentin Le Guennec joined the room.19:40:09
@lambdatheultimatealias:matrix.orglambdatheultimatealiasHere's a more helpful link. It looks like there's a PR to be reviewed already: https://github.com/NixOS/nixpkgs/pull/37656420:10:36
@hellwolf:matrix.orghellwolf
nix-shell$ ghc-pkg list --global
/nix/store/qj54vnsx6nk18nmy8r21w7src01hbq2g-ghc-9.10.1/lib/ghc-9.10.1/lib/package.conf.d
...

How do you get that /nix/store/qj54vnsx6nk18nmy8r21w7src01hbq2g-ghc-9.10.1/lib/ghc-9.10.1/lib/package.conf.d path programatically?

21:56:10
@hellwolf:matrix.orghellwolf
$ ghc --print-global-package-db
/nix/store/qj54vnsx6nk18nmy8r21w7src01hbq2g-ghc-9.10.1/lib/ghc-9.10.1/lib/package.conf.d

23:25:49
27 Jan 2025
@b:chreekat.netchreekatI've looked at this some more, comparing results on different commits, and I haven't found any reason to think I'm wrong yet12:51:51
@b:chreekat.netchreekatI did see a commit around that time that reverted a stackage bump because all-cabal-hashes apparently wasn't updating? I need to ask more questions about that. But could it have had an effect?12:52:55
@ahaskeller:matrix.orgahaskeller joined the room.13:52:41
@sternenseemann:systemli.orgsterni (he/him)hm refined github has a feature where you can alt click on the hidden comments thing and it tries to load all of them 17:06:41
@sternenseemann:systemli.orgsterni (he/him)it's still pretty clunky but better than clicking a million times17:06:57
@profpatsch:augsburg.oneProfpatschsternenseemann: IT WHAT?17:29:29
@profpatsch:augsburg.oneProfpatschTIL17:29:35
@sternenseemann:systemli.orgsterni (he/him)I’ve installed it now for this purpose only, haskell-updates is unusable without it now with the extra noise GitHub’s lack of base commit updating causes17:30:55
@profpatsch:augsburg.oneProfpatsch sternenseemann: Ah, refined github 17:36:13
@profpatsch:augsburg.oneProfpatschI thought vanilla17:36:15

Show newer messages


Back to Room ListRoom Version: 6