Failed to parse /nix/store/hk9ikz0hwh3swvqmcwmgcr5dxw1f736p-source/cabal.project: {"type":"error","value":{"context":"parsec.string","msg":"expected string 'packages:'","offset":0,"str":"-- Generated by stackage-to-hackage
with-compiler: ghc-8.10.7 .......
Sample cabal.project
-- Generated by stackage-to-hackage
with-compiler: ghc-8.10.7
packages:
./
source-repository-package
type: git
location: https://github.com/aravindgopall/hsaml2.git
tag: d4ecf51a0bf3733eb1ff8724a691b0200b3355ee
allow-older: *
allow-newer: *
@Neeraj The cabal.project parser is pretty limited.
Move packages:
to the first line, and see if that works.
And it will only recognizes packages
, not others. You have to specify them in Nix.
The first two lines should look like:
❯ head -n 2 cabal.project
packages:
./
Srid said:
And it will only recognizes
packages
, not others. You have to specify them in Nix.
For eg., source-repository-package
should be specified as flake inputs and used as a dependency override. See https://community.flake.parts/haskell-flake/dependency#path
(Oops, I realized I linked to haskell-flake docs but of course you'd use the same callCabal2nix
function to specify these source-repository-package using flake inputs)
How to exclude cabal.project
so that nix will not parse it?
got it. Using nix-filter solved it
Last updated: Jan 18 2025 at 05:14 UTC