diff options
Diffstat (limited to 'Biz/Bild.hs')
-rw-r--r-- | Biz/Bild.hs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 4d7fadd..845daf1 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -469,18 +469,23 @@ test loud Target {..} = case compiler of >> pure Exit.ExitSuccess repl :: Bool -> Target -> IO Exit.ExitCode -repl _ Target {..} = +repl _ Target {..} = do + root <- Env.getEnv "BIZ_ROOT" case compiler of c | c `elem` [GhcExe, GhcLib] -> - [ ["--packages"], - ["haskellPackages." <> d | d <- Set.toList langdeps], - Set.toList sysdeps, - [ "--command", - "ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci " <> path - ] + -- this is a complicated set of string joins which basically means to + -- create a command like this: + -- nix-shell -E "with import Biz/Bild.nix {}; mkGhcPackageSet (h: [h.pkg])" + [ "--expr", + "with import " <> root <> "/Biz/Bild.nix {};" + <> "mkGhcPackageSet (h: [" + <> joinWith " " ["h." <> d | d <- Set.toList langdeps] + <> "])", + -- Set.toList sysdeps, + "--command", + "ghci -i$BIZ_ROOT -ghci-script $BIZ_ROOT/.ghci " <> path ] - |> mconcat |> Process.callProcess "nix-shell" >> Exit.exitSuccess _ -> |