@@ -304,20 +304,8 @@ nixShellWithHoogle root isPure shell' command = do
304304
305305projectShell :: MonadObelisk m => FilePath -> Bool -> String -> Maybe String -> m ()
306306projectShell root isPure shellName command = do
307− nixpkgsPath <- fmap T.strip $ readProcessAndLogStderr Debug $ setCwd (Just root) $ proc nixExePath ["eval", "(import .obelisk/impl {}).nixpkgs.path"]
308− nixRemote <- liftIO $ lookupEnv "NIX_REMOTE"
309− (_, _, _, ph) <- createProcess_ "runNixShellAttr" $ setDelegateCtlc True $ setCwd (Just root) $ proc "nix-shell" $
310− [ "default.nix"] <>
311− ["--pure" | isPure] <>
312− [ "-A"
313− , "shells." <> shellName
314− ] <> case command of
315− Nothing -> []
316− Just c ->
317− -- TODO: Escape nixpkgsPath and nixRemote
318− [ "--run"
319− , "export NIX_PATH=nixpkgs=" <> T.unpack nixpkgsPath <> "; " <>
320− maybe "" (\v -> "export NIX_REMOTE=" <> v <> "; ") nixRemote <>
321− c
322− ]
307+ defShellConfig <- nixShellRunConfig root isPure command
308+ (_, _, _, ph) <- createProcess_ "runNixShellAttr" $ nixShellRunProc root $ defShellConfig
309+ & nixShellConfig_common . nixCmdConfig_target . target_path ?~ "default.nix"
310+ & nixShellConfig_common . nixCmdConfig_target . target_attr ?~ ("shells." <> shellName)
323311 void $ liftIO $ waitForProcess ph