@@ -40,7 +40,7 @@ import System.IO.Temp
40import System.IO.Unsafe (unsafePerformIO)
40import System.IO.Unsafe (unsafePerformIO)
41import System.Posix (FileStatus, FileMode, CMode (..), UserID, deviceID, fileID, fileMode, fileOwner, getFileStatus, getRealUserID)
41import System.Posix (FileStatus, FileMode, CMode (..), UserID, deviceID, fileID, fileMode, fileOwner, getFileStatus, getRealUserID)
42import System.Posix.Files
42import System.Posix.Files
43−import Text.ShellEscape (Bash, bytes, bash)
43+import Text.ShellEscape (bash, bytes)
45import GitHub.Data.GitData (Branch)
45import GitHub.Data.GitData (Branch)
46import GitHub.Data.Name (Name)
46import GitHub.Data.Name (Name)
@@ -272,7 +272,7 @@ filePermissionIsSafe s umask = not fileWorldWritable && fileGroupWritable <= uma
272 fileGroupWritable = fileMode s .&. 0o020 == 0o020
272 fileGroupWritable = fileMode s .&. 0o020 == 0o020
273 umaskGroupWritable = umask .&. 0o020 == 0
273 umaskGroupWritable = umask .&. 0o020 == 0
275−nixShellRunConfig :: MonadObelisk m => FilePath -> Bool -> Maybe [Bash] -> m NixShellConfig
275+nixShellRunConfig :: MonadObelisk m => FilePath -> Bool -> Maybe String -> m NixShellConfig
276nixShellRunConfig root isPure command = do
276nixShellRunConfig root isPure command = do
277 nixpkgsPath <- fmap T.strip $ readProcessAndLogStderr Debug $ setCwd (Just root) $
277 nixpkgsPath <- fmap T.strip $ readProcessAndLogStderr Debug $ setCwd (Just root) $
278 proc nixExePath ["eval", "(import .obelisk/impl {}).nixpkgs.path"]
278 proc nixExePath ["eval", "(import .obelisk/impl {}).nixpkgs.path"]
@@ -283,7 +283,7 @@ nixShellRunConfig root isPure command = do
283 & nixShellConfig_run .~ (command <&> \cs -> unwords $ concat
283 & nixShellConfig_run .~ (command <&> \cs -> unwords $ concat
284 [ ["export", BSU.toString . bytes . bash $ "NIX_PATH=nixpkgs=" <> encodeUtf8 nixpkgsPath, ";"]
284 [ ["export", BSU.toString . bytes . bash $ "NIX_PATH=nixpkgs=" <> encodeUtf8 nixpkgsPath, ";"]
285 , maybe [] (\v -> ["export", BSU.toString . bytes . bash $ "NIX_REMOTE=" <> encodeUtf8 (T.pack v), ";"]) nixRemote
285 , maybe [] (\v -> ["export", BSU.toString . bytes . bash $ "NIX_REMOTE=" <> encodeUtf8 (T.pack v), ";"]) nixRemote
286− , fmap (BSU.toString . bytes) cs
286+ , [cs]
289nixShellRunProc :: NixShellConfig -> ProcessSpec
289nixShellRunProc :: NixShellConfig -> ProcessSpec
@@ -296,7 +296,7 @@ nixShellWithoutPkgs
296 -> Bool -- ^ Should we chdir to the package root in the shell?
296 -> Bool -- ^ Should we chdir to the package root in the shell?
297 -> Map Text FilePath -- ^ Package names mapped to their paths
297 -> Map Text FilePath -- ^ Package names mapped to their paths
298 -> String -- ^ Shell attribute to use (e.g. @"ghc"@, @"ghcjs"@, etc.)
298 -> String -- ^ Shell attribute to use (e.g. @"ghc"@, @"ghcjs"@, etc.)
299− -> Maybe [Bash] -- ^ If 'Just' run the given command; otherwise just open the interactive shell
299+ -> Maybe String -- ^ If 'Just' run the given command; otherwise just open the interactive shell
301nixShellWithoutPkgs root isPure chdirToRoot packageNamesAndPaths shellAttr command = do
301nixShellWithoutPkgs root isPure chdirToRoot packageNamesAndPaths shellAttr command = do
302 packageNamesAndAbsPaths <- liftIO $ for packageNamesAndPaths makeAbsolute
302 packageNamesAndAbsPaths <- liftIO $ for packageNamesAndPaths makeAbsolute
@@ -314,7 +314,7 @@ nixShellWithoutPkgs root isPure chdirToRoot packageNamesAndPaths shellAttr comma
315 void $ waitForProcess ph
315 void $ waitForProcess ph
317−nixShellWithHoogle :: MonadObelisk m => FilePath -> Bool -> String -> Maybe [Bash] -> m ()
317+nixShellWithHoogle :: MonadObelisk m => FilePath -> Bool -> String -> Maybe String -> m ()
318nixShellWithHoogle root isPure shell' command = do
318nixShellWithHoogle root isPure shell' command = do
319 defShellConfig <- nixShellRunConfig root isPure command
319 defShellConfig <- nixShellRunConfig root isPure command
320 (_, _, _, ph) <- createProcess_ "nixShellWithHoogle" $ setCwd (Just root) $ nixShellRunProc $ defShellConfig
320 (_, _, _, ph) <- createProcess_ "nixShellWithHoogle" $ setCwd (Just root) $ nixShellRunProc $ defShellConfig