!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

735 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.org147 Servers

Load older messages


SenderMessageTime
1 Aug 2024
@vigress9:matrix.org@vigress9:matrix.org changed their profile picture.15:54:02
@elfahor:matrix.orgelfahor (she) joined the room.17:13:53
@elfahor:matrix.orgelfahor (she) hello! I'm working on my first haskell project, and I'm trying to add a dependency on a library which requires FFI with a libfoo.so. My project is built with Stack. The issue is that it can't find libfoo.so. I see that there is an option extra-library-dirs to give stack the location, but with Nix it would need hardcoding the nix store path.
Ideally, I could pass the lib dir via an env var set in my shell.nix, but I can't find how to do that.
Maybe I could use a custom Setup.hs that loads the envvar and calls stack with it?
17:18:56
@lambda_brawler:matrix.orgbdubYou pretty much answered your own question.. your on the right track 18:26:53
@elfahor:matrix.orgelfahor (she) with the custom Setup.hs? Ok I'll try to do that 19:11:08
@mangoiv.:matrix.orgMangoIVThat’s not a good way of doing it. Consider pkg-config. 22:23:33
@cdepillabout:matrix.orgcdepillabout
In reply to @elfahor:matrix.org
hello! I'm working on my first haskell project, and I'm trying to add a dependency on a library which requires FFI with a libfoo.so. My project is built with Stack. The issue is that it can't find libfoo.so. I see that there is an option extra-library-dirs to give stack the location, but with Nix it would need hardcoding the nix store path.
Ideally, I could pass the lib dir via an env var set in my shell.nix, but I can't find how to do that.
Maybe I could use a custom Setup.hs that loads the envvar and calls stack with it?
There are a couple different ways to do this, but what seems like the most common is to setup your stack.yaml to use a stack nix shell, and use buildStackProject within it. You can pass the libraries you need as buildInputs: https://github.com/cdepillabout/termonad/blob/master/.nix-helpers/stack-shell.nix#L8
22:34:28
@cdepillabout:matrix.orgcdepillaboutYou should also make sure to read through https://docs.haskellstack.org/en/stable/topics/nix_integration/ if you haven't already.22:35:18
2 Aug 2024
@pnotequalnp:matrix.orgpnotequalnpAre Wasm and/or JS targeting GHCs on Nixpkgs? Are there plans to add them?06:43:52
@mangoiv.:matrix.orgMangoIVJS, yes, WASM, no. 06:45:32
@mangoiv.:matrix.orgMangoIVIf you just want a compiler, then you can look at ghcs-nix on gitlab which has an MR open which can build you a compiler. 06:46:11
@pnotequalnp:matrix.orgpnotequalnp
In reply to @mangoiv.:matrix.org
JS, yes, WASM, no.
Where's the JS one?
07:16:51
@alexfmpe:matrix.orgalexfmpepkgsCross.ghcjs.haskell.pakckages.ghc98.ghc16:01:24
@alexfmpe:matrix.orgalexfmpe* pkgsCross.ghcjs.haskell.packages.ghc98.ghc16:01:42
@alexfmpe:matrix.orgalexfmpe* pkgsCross.ghcjs.haskell.packages.ghc98.ghc16:01:50
@seanybaggins:matrix.orgSean LinkAsked this a while back and am having trouble searching though the history. Any update for when hledger will be updated? Feel like it has been at 1.23.3 for a really long time.21:35:40
@maralorn:maralorn.demaralornIf I am not mistaken it just has been.21:36:30
@maralorn:maralorn.demaralornYes, hledger 1.32.3 will be reaching nixos-unstable within the next two days or something.21:38:23
@maralorn:maralorn.demaralornAh, well.21:39:56
@maralorn:maralorn.demaralornYou typod. And it has been that version for a while. 😄21:40:10
@maralorn:maralorn.demaralornThen the answer is simple: We follow stackage LTS.21:40:49
@seanybaggins:matrix.orgSean Link1.32.3 is what is currently in unstable. hledger is up to 1.34 upstream21:40:51
@maralorn:maralorn.demaralornSo unless someone opens a pull request to manually bump hledger. Which I would gladly accept at this point we are stuck here. Probably for quite a few more months.21:41:44
@maralorn:maralorn.demaralorn * So unless someone opens a pull request to manually bump hledger, which I would gladly accept at this point, we are stuck here. Probably for quite a few more months.21:41:59
@seanybaggins:matrix.orgSean LinkHmmmm I don't think I know enough at the current moment to implement this quickly. My understanding of how we query stackage or hackage to write our nix expressions is low.21:48:59
@maralorn:maralorn.demaralornYeah, it’s not trivial, I admit.21:49:22
@maralorn:maralorn.demaralornI think I have this on my todolist for about 2 years at this point.21:49:47
@seanybaggins:matrix.orgSean Link
In reply to @maralorn:maralorn.de
I think I have this on my todolist for about 2 years at this point.
Incrementing the version of hledger, changing where we get packages upstream within unstable, or documenting the current process?
21:51:03
@maralorn:maralorn.demaralornSpecifically opting out of the stackage pin for hledger and instead using always the newest hledger on hackage.21:52:46
@seanybaggins:matrix.orgSean Link That sounds glorious. It may be nice to have 2 attribute sets haskelPackagesStackageLTS and haskelPackagesHackageUnstable 21:54:15

Show newer messages


Back to Room ListRoom Version: 6