Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Haskell support #131

Open
lf- opened this issue Sep 14, 2022 · 1 comment
Open

Haskell support #131

lf- opened this issue Sep 14, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@lf-
Copy link

lf- commented Sep 14, 2022

It would be sweet if riff could provision a haskell compiler and haskell language server with the appropriate native dependencies.

It's true that nixpkgs can do this itself but sometimes you legitimately don't want nixpkgs to give you any of the haskell libraries, especially while hacking on random software. Or it's just too Annoying to write a nix expression for all the stuff.

This might be a bit of a tall order: the hard example I'd suggest is persistent-sqlite, which has a dependency on native sqlite.

The system sqlite library gets into there in librarySystemDepends (see hackage-packages.nix in nixpkgs)

That gets found by cabal2nix from a package flag that adds an extra-libraries declaration to the cabal file https://github.com/yesodweb/persistent/blob/master/persistent-sqlite/persistent-sqlite.cabal#L71 (the flag is set by cabal2nix per https://github.com/NixOS/cabal2nix/blob/master/src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs#L55)

Thought of course of implementation:

Automate calling cabal2nix without needing to know the package name. Probably read cabal.project if possible to find all the local packages.

Write a funny Nix function that extracts all the transitive system dependencies from some haskell derivation from cabal2nix, then constructs a mkShell.

cc @Hoverbear

@lf-
Copy link
Author

lf- commented Sep 15, 2022

The specific motivation for this is that nixpkgs forces you to a particular version of libraries (sometimes undesirable if you don't wanna write an overlay), and often things are marked broken. That said, it would also be good to have a mode where it just cabal2nix's the thing for you and does provide binary libraries.

@cole-h cole-h added the enhancement New feature or request label Oct 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants