Closed eownerdead closed 9 months ago
You can use nix-shell
's interpreter capabilities for this together with ghcWithPackages
from nixpkgs for providing the dependencies and ghc.
But... we can't run them without Nix, need to rewrite cabal scripts, and probably can't package them. Sorry for the late response🙏
@eownerdead cabal2nix
won't be able to give you a solution that works without Nix. It is merely a tool that generates Nix code. The cabal
shebang is your best shot then.
With
cabal run
all dependencies will be built. However, if Nix cache can be used Haskell will become more useful for scripting language, like Python. Also, it may be more convenient if it can be executable likecabal2nix --run ./script.hs
. Sorry if this is already supported or duplicated. Regards.