stack-2.3.3: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Config

Description

The general Stack configuration that starts everything off. This should be smart to falback 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

Documentation

loadConfig :: HasRunner 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.

getImplicitGlobalProjectDir :: HasLogFunc 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.

checkOwnership :: MonadIO m => Path Abs Dir -> m () Source #

checkOwnership dir throws UserDoesn'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, NoSuchDirectory (parent dir) is thrown.

getInContainer :: MonadIO m => m Bool Source #

True if we are currently running inside a Docker container.

getInNixShell :: MonadIO m => m Bool Source #

True if we are currently running inside a Nix.

getProjectConfig Source #

Arguments

:: HasLogFunc 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.