obsidiansystems / obelisk

Functional reactive web and mobile applications, with batteries included.
https://reflex-frp.org
BSD 3-Clause "New" or "Revised" License
948 stars 104 forks source link

callCabal2nix never works inside an Obelisk Project #1091

Closed romefeller closed 1 week ago

romefeller commented 1 month ago

I have a default.nix like this:

with obelisk; project ./. ({ pkgs, hackGet, ... }: { android.applicationId = "systems.obsidian.obelisk.examples.minimal"; android.displayName = "Obelisk Minimal Example"; ios.bundleIdentifier = "systems.obsidian.obelisk.examples.minimal"; ios.bundleName = "Obelisk Minimal Example"; packages = let haskell-charts = hackGet ./deps/haskell-chart; in { chart = haskell-charts + "/chart"; chart-diagrams = pkgs.haskell.lib.dontHaddock (pkgs.haskell.lib.doJailbreak (pkgs.haskellPackages.callCabal2nix "chart-diagrams" (haskell-charts + "/chart-diagrams") {})); fsnotify = hackGet ./deps/hfsnotify; };

I need charts-diagrams to be jail-broken but I get this error:

error: builder for '/nix/store/sp6jpav14sn1dgli0zzn0simfl2cwr64-cabal2nix-chart-diagrams.drv' failed with exit code 1; last 1 log lines:

cabal2nix: user error (*** Found neither a .cabal file nor package.yaml. Exiting.) For full logs, run 'nix log /nix/store/sp6jpav14sn1dgli0zzn0simfl2cwr64-cabal2nix-chart-diagrams.drv'. (use '--show-trace' to show detailed location information)

I had the same issue with hfsnotify but when I use ob thunk pack everything works fine.

Is this an Obelisk issue or a nix one? I really do not remember if I ever got into this before. I am using obelisk-command-0.9.0.1

alexfmpe commented 1 month ago

packages is for paths, you want the callCabal2nix call inside overrides. See https://github.com/reflex-frp/reflex-platform/blob/6fbaf9b5dafd3e1afc538049654fb8ab8ce64965/project/default.nix