Skip to content

Commit 59f0b2f

Browse files
committed
Merge branch 'stable'
2 parents 3d9e943 + 1f31a1f commit 59f0b2f

File tree

1 file changed

+62
-39
lines changed

1 file changed

+62
-39
lines changed

doc/configure/yaml/yaml_configuration.md

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,68 @@
11
<div class="hidden-warning"><a href="https://docs.haskellstack.org/"><img src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack/doc/img/hidden-warning.svg"></a></div>
22

3-
# Configuration and customisation
3+
# Configuration
44

5-
Stack is configured by the content of YAML files.
5+
Stack is configured by the content of [YAML](https://yaml.org/) files.
66

7-
!!! info
7+
## Project-specific and non-project specific options
88

9-
A Haskell package is an organised collection of Haskell code and related
10-
files. It is described by a Cabal file or a `package.yaml` file (which can
11-
be used to generate a Cabal file). The package description is itself part of
12-
the package. Its file is located in the root directory of a project package
13-
or dependency located locally.
9+
Stack's configuration options are each of one of two types:
1410

15-
A Stack project is a local directory that contains a Stack project-level
16-
configuration file (`stack.yaml`, by default). A project may relate to more
17-
than one project package. A single-package project's directory will usually
18-
also be the project package's root directory.
11+
<div class="grid cards" markdown>
1912

20-
## YAML configuration
13+
- :material-account:{ .lg .middle } __Project-specific__
2114

22-
Stack's YAML configuration options break down into
23-
[project-specific](project.md) options and
24-
[non-project-specific](non-project.md) options. The former are configured at the
25-
project level. The latter are configured at the project level or globally.
15+
Configured at the project level
2616

27-
The **project-level** configuration file (`stack.yaml`, by default) contains
28-
project-specific options and may contain non-project-specific options. However,
29-
non-project-specific options in the project-level configuration file in the
30-
`global-project` directory (see below) are ignored by Stack.
17+
---
18+
19+
[:octicons-arrow-right-24: Learn more](project.md)
20+
21+
- :material-account-multiple:{ .lg .middle } __Non-project specific__
22+
23+
Configured globally or at the project level.
24+
25+
---
26+
27+
[:octicons-arrow-right-24: Learn more](non-project.md)
28+
29+
</div>
30+
31+
## Project-level and global configuration files
32+
33+
Stack's configuration files are each of one of two types:
34+
35+
<div class="grid cards" markdown>
36+
37+
- :material-language-haskell:{ .lg .middle } __Project-level__
38+
39+
Named `stack.yaml` by default.
40+
41+
---
42+
43+
Contains [project-specific](project.md) options and may contain
44+
[non-project-specific](non-project.md) options.
45+
46+
Non-project-specific options in the project-level configuration file in the
47+
`global-project` directory (see below) are ignored by Stack.
48+
49+
- :octicons-globe-24:{ .lg .middle } __Global__
50+
51+
Named `config.yaml`.
52+
53+
There is a user-specific file and there may be a system-wide one. If a
54+
user-specific file does not exist, then Stack will create one.
55+
56+
---
57+
58+
Contains [non-project-specific](non-project.md) options.
59+
60+
An option set in the user-specific file will override a corresponding option
61+
set in the system-wide file (if it exists).
62+
63+
</div>
64+
65+
## Location of project-level configuration
3166

3267
Stack obtains project-level configuration from one of the following (in order of
3368
preference):
@@ -38,16 +73,13 @@ preference):
3873
4. A file name `stack.yaml` in the `global-project` directory in the
3974
[Stack root](../../topics/stack_root.md).
4075

41-
The **global** configuration files (`config.yaml`) contain only
42-
non-project-specific options. There is a user-specific global confguration file
43-
and there may be an optional system-wide global configuration file. If a
44-
user-specific global configuration file does not exist, then Stack will create
45-
one. An option set in the user-specific file will override a corresponding
46-
option set in the system-wide file (if it exists).
76+
## Location of global configuration
4777

48-
The default location of these files depends on the operating system and, in the
49-
case of the user-specific file, whether Stack is configured to use the XDG Base
50-
Directory Specification. An absolute path to these files can be specified by the
78+
The default location of global configuration files depends on the operating
79+
system and, in the case of the user-specific file, whether Stack is configured
80+
to use the XDG Base Directory Specification.
81+
82+
An absolute path to these files can be specified by the
5183
[`STACK_CONFIG`](../environment_variables.md#stack_config) and
5284
[`STACK_GLOBAL_CONFIG`](../environment_variables.md#stack_config) environment
5385
variables, respectively.
@@ -88,12 +120,3 @@ variables, respectively.
88120
the `XDG_CONFIG_HOME` environment variable does not exist, the default is
89121
`~/.config/stack` on Unix-like operating systems and `%APPDIR%\stack` on
90122
Windows.
91-
92-
This page is intended to document fully all YAML configuration options. If you
93-
identify any inaccuracies or incompleteness, please update the page, and if
94-
you're not sure how, open an issue labeled "question".
95-
96-
If you wish to understand the difference between a `stack.yaml` files and a
97-
Cabal file (named `<package_name>.cabal`), see the
98-
[stack.yaml vs a Cabal file](../../topics/stack_yaml_vs_cabal_package_file.md)
99-
documentation.

0 commit comments

Comments
 (0)