Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
The general Stack configuration that starts everything off. This should be smart to fallback if there is no stack.yaml, instead relying on whatever files are available.
If there is no stack.yaml, and there is a cabal.config, we read in those constraints, and if there's a cabal.sandbox.config, we read any constraints from there and also find the package database from there, etc. And if there's nothing, we should probably default to behaving like cabal, possibly with spitting out a warning that "you should run `stk init` to make things better".
Synopsis
- loadConfig :: (HasRunner env, HasTerm env) => (Config -> RIO env a) -> RIO env a
- loadConfigYaml :: HasLogFunc env => (Value -> Parser (WithJSONWarnings a)) -> Path Abs File -> RIO env a
- packagesParser :: Parser [String]
- getImplicitGlobalProjectDir :: HasTerm env => Config -> RIO env (Path Abs Dir)
- getSnapshots :: HasConfig env => RIO env Snapshots
- makeConcreteResolver :: HasConfig env => AbstractResolver -> RIO env RawSnapshotLocation
- checkOwnership :: MonadIO m => Path Abs Dir -> m ()
- getInContainer :: MonadIO m => m Bool
- getInNixShell :: MonadIO m => m Bool
- defaultConfigYaml :: (IsString s, Semigroup s) => s
- getProjectConfig :: HasTerm env => StackYamlLoc -> RIO env (ProjectConfig (Path Abs File))
- withBuildConfig :: RIO BuildConfig a -> RIO Config a
- withNewLogFunc :: MonadUnliftIO m => GlobalOpts -> Bool -> StylesUpdate -> (LogFunc -> m a) -> m a
Documentation
loadConfig :: (HasRunner env, HasTerm env) => (Config -> RIO env a) -> RIO env a Source #
Load the configuration, using current directory, environment variables, and defaults as necessary.
loadConfigYaml :: HasLogFunc env => (Value -> Parser (WithJSONWarnings a)) -> Path Abs File -> RIO env a Source #
Load and parse YAML from the given config file. Throws
ParseConfigFileException
when there's a decoding error.
packagesParser :: Parser [String] Source #
getImplicitGlobalProjectDir :: HasTerm env => Config -> RIO env (Path Abs Dir) Source #
Get the location of the implicit global project directory. If the directory already exists at the deprecated location, its location is returned. Otherwise, the new location is returned.
getSnapshots :: HasConfig env => RIO env Snapshots Source #
Download the Snapshots
value from stackage.org.
makeConcreteResolver :: HasConfig env => AbstractResolver -> RIO env RawSnapshotLocation Source #
Turn an AbstractResolver
into a Resolver
.
checkOwnership :: MonadIO m => Path Abs Dir -> m () Source #
throws checkOwnership
dirUserDoesn'tOwnDirectory
if dir
isn't
owned by the current user.
If dir
doesn't exist, its parent directory is checked instead.
If the parent directory doesn't exist either,
is thrown.NoSuchDirectory
(parent
dir)
getInContainer :: MonadIO m => m Bool Source #
True
if we are currently running inside a Docker container.
defaultConfigYaml :: (IsString s, Semigroup s) => s Source #
:: HasTerm env | |
=> StackYamlLoc | Override stack.yaml |
-> RIO env (ProjectConfig (Path Abs File)) |
Get the location of the project config file, if it exists.
withBuildConfig :: RIO BuildConfig a -> RIO Config a Source #
Load the build configuration, adds build-specific values to config loaded
by loadConfig
. values.
:: MonadUnliftIO m | |
=> GlobalOpts | |
-> Bool | Use color |
-> StylesUpdate | |
-> (LogFunc -> m a) | |
-> m a |
Runs the provided action with a new LogFunc
, given a StylesUpdate
.