Cabal2nix haskell flake doesn't recognise the moved or renamed cabal file

I had a directory ~/projects/haskell/blog, and I mvd that directory to ~/projects/haskell/site, and I ran sed s/blog/site/g on everything in the directory as well, removed the flake.lock and .direnv file, and i renamed blog.cabal to site.cabal. when i try to build it, it says that there is not a proper .cabal file. when i change site.cabal back to blog.cabal it can recognise it. any idea how to tell it to use site.cabal instead?
here’s my flake.nix: https://paste.rs/GprUr
and my site.cabal: https://paste.rs/r0hwC

You need to adjust callCabal2Nix parameter on line 9 which is currently site so the tool looks for site.cabal file.

1 Like

I’m kind of confused-- I’ve just surfed the cabal2nix repo looking for how exactly to do that, but it doesn’t seem like it says anything about that. I’ve tried to change the “site” string to “site.cabal” but it doesn’t change anything-- I think it was just “blog” before.

I fixed it. This was stupid of me. I just didn’t git add the cabal file…

1 Like

For the record, callCabal2nix no longer determines the cabal file name from the name argument. This is unnecessary, as Cabal only permits one cabal file per directory.

2 Likes