Is it possible to break up a long #! nix-shell -p
line into multiple lines?
Example:
#!/usr/bin/env nix-shell
#! nix-shell -p "haskell.packages.ghc822.ghcWithPackages (p: with p; [lens text bytestring hspec brick async])"
#! nix-shell -i "runghc"
{-# language OverloadedStrings #-}
import Data.Text
import Control.Lens
import Data.Monoid
main = print $ ("foo" :: Text, True) & _1 %~ (<> " bar")
I've tried like this, but unsurprisingly that GHC doesn't see the lens and text packages.
#!/usr/bin/env nix-shell
#! nix-shell -p "haskell.packages.ghc822.text"
#! nix-shell -p "haskell.packages.ghc822.lens"
#! nix-shell -p "haskell.packages.ghc822.ghc"
#! nix-shell -i "runghc"
{-# language OverloadedStrings #-}
import Data.Text
import Control.Lens
import Data.Monoid
main = print $ ("foo" :: Texts, True) & _1 %~ (<> " bar")
I vaguely remember that someone on GitHub wrote a custom #!
interpreter for nix that allows for special handling of Haskell (and other) package dependencies, allowing them to break up into multiple lines, but its name eludes me and I can't find it. Perhaps some of you remember?
Any other ideas I could try?