Skip to content

Commit b7794d4

Browse files
committed
Fix commercialhaskell#6610 Improve documentation of global configuration files
1 parent baf8769 commit b7794d4

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

Diff for: doc/yaml_configuration.md

+27-7
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,39 @@ preference):
4040
4. A file name `stack.yaml` in the `global-project` directory in the
4141
[Stack root](stack_root.md).
4242

43-
The **global** configuration file (`config.yaml`) contains only
44-
non-project-specific options. The location of this file depends on the operating
45-
system and whether Stack is configured to use the XDG Base Directory
46-
Specification.
43+
The **global** configuration files (`config.yaml`) contain only
44+
non-project-specific options. There is a user-specific global confguration file
45+
and there may be an optional system-wide global configuration file. If a
46+
user-specific global configuration file does not exist, then Stack will create
47+
one. An option set in the user-specific file will override a corresponding
48+
option set in the system-wide file (if it exists).
49+
50+
The default location of these files depends on the operating system and, in the
51+
case of the user-specific file, whether Stack is configured to use the XDG Base
52+
Directory Specification. An absolute path to these files can be specified by the
53+
[`STACK_CONFIG`](environment_variables.md#stack_config) and
54+
[`STACK_GLOBAL_CONFIG`](environment_variables.md#stack_config) environment
55+
variables, respectively.
4756

4857
=== "Unix-like"
4958

50-
`config.yaml` is located in `/etc/stack` (for system-wide options); and/or
51-
in the [Stack root](stack_root.md) (for user-specific options).
59+
The default locations are:
60+
61+
* system-wide: `/etc/stack/config.yaml`; and
62+
* user-specific: `config.yaml` in the [Stack root](stack_root.md).
63+
64+
!!! note
65+
66+
For compatibility with Stack 0.1.5.0 and earlier, if deprecated file
67+
`/etc/stack/config` exists, then Stack will use it instead of
68+
`/etc/stack/config.yaml`.
5269

5370
=== "Windows"
5471

55-
`config.yaml` is located in the [Stack root](stack_root.md).
72+
The default locations are:
73+
74+
* system-wide: none; and
75+
* user-specific: `config.yaml` in the [Stack root](stack_root.md).
5676

5777
=== "XDG Base Directory Specification"
5878

0 commit comments

Comments
 (0)