Research of IFD issue from callCabal2nix #1

Open
opened 2026-05-18 07:59:53 +00:00 by xfeusw · 11 comments
Owner

To setup Haskell project in Nix, we usually use callCabal2nix (e.g. relago-support). As it is written using Haskell, it's not unusual that we meet IFD (import from derivation) issue from Nix.

So, we need to fix it

To setup Haskell project in Nix, we usually use [`callCabal2nix`](https://github.com/NixOS/nixpkgs/blob/9c305c7f7cc785d84143905b042570c0c6bf7312/pkgs/development/haskell-modules/cabal2nix-unstable/cabal2nix.nix#L2) (e.g. [`relago-support`](https://git.oss.uzinfocom.uz/xinux/relago-support)). As it is written using Haskell, it's not unusual that we meet [IFD](https://nixcademy.com/posts/what-is-ifd-ups-and-downs/) (import from derivation) issue from Nix. So, we need to fix it
Author
Owner

I found out about cabal2nixWithoutIFD

I found out about [`cabal2nixWithoutIFD`](https://github.com/cdepillabout/cabal2nixWithoutIFD)
Author
Owner
Found - [Native support for import for derivation in Hercules](https://blog.hercules-ci.com/2019/08/30/native-support-for-import-for-derivation/)
Author
Owner
[Figure out how to make IFD work properly](https://github.com/NixOS/nix/issues/954)
Author
Owner
[Generate Hackage/LTS nix expressions on the fly rather than have them in the repo](https://github.com/NixOS/nixpkgs/issues/16130)
Author
Owner
https://github.com/NixOS/nixpkgs/issues/16130#issuecomment-229939552
Author
Owner
https://github.com/NixOS/nix/issues/954#issuecomment-365281661
Author
Owner
[Purely functional metadata-rich derivation poisoning](https://github.com/NixOS/nix/issues/1052)
Author
Owner

@xfeusw wrote in #1 (comment):

I found out about cabal2nixWithoutIFD

Researching PureScript because of cabal2nixWithoutIFD. Besides, researching PureNix too. Because cabal2nixWithoutIFD is written in PureScript and transpiled to Nix via PureNix

@xfeusw wrote in https://git.oss.uzinfocom.uz/xfeusw/contributions/issues/1#issuecomment-443: > I found out about [`cabal2nixWithoutIFD`](https://github.com/cdepillabout/cabal2nixWithoutIFD) Researching [PureScript](https://www.purescript.org/) because of `cabal2nixWithoutIFD`. Besides, researching [PureNix](https://github.com/purenix-org/purenix) too. Because cabal2nixWithoutIFD is written in PureScript and transpiled to Nix via PureNix
Author
Owner

I should check out Hydra configuration and also should research about allowing IFD in Hydra according to edolstra's comment

I should check out Hydra configuration and also should research about allowing IFD in Hydra according to [edolstra's comment](https://git.oss.uzinfocom.uz/xfeusw/contributions/issues/1#issuecomment-447)
Author
Owner
[github:justinwoo/easy-purescript-nix](https://github.com/justinwoo/easy-purescript-nix)
Author
Owner
https://stackoverflow.com/questions/27968909/how-to-get-cabal-and-nix-work-together
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
xfeusw/contributions#1
No description provided.