diff options
-rw-r--r-- | changelog.md | 3 | ||||
-rw-r--r-- | compiler/nimconf.nim | 4 | ||||
-rw-r--r-- | doc/nimc.rst | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md index 441b09042..73d526136 100644 --- a/changelog.md +++ b/changelog.md @@ -227,4 +227,7 @@ compile time functions / static blocks. Only in templates / regular code it retains it's old behavior. This new feature can be accessed via {.experimental: "dynamicBindSym".} pragma/switch. +- On Posix systems the global system wide configuration is now put under ``/etc/nim/nim.cfg``, + it used to be ``/etc/nim.cfg``. Usually it does not exist, however. + ### Bugfixes diff --git a/compiler/nimconf.nim b/compiler/nimconf.nim index d3b4645dc..cb7e52cf7 100644 --- a/compiler/nimconf.nim +++ b/compiler/nimconf.nim @@ -228,8 +228,8 @@ proc getSystemConfigPath(conf: ConfigRef; filename: string): string = let p = getPrefixDir(conf) result = joinPath([p, "config", filename]) when defined(unix): - if not existsFile(result): result = joinPath([p, "etc", filename]) - if not existsFile(result): result = "/etc/" & filename + if not existsFile(result): result = joinPath([p, "etc/nim", filename]) + if not existsFile(result): result = "/etc/nim/" & filename proc loadConfigs*(cfg: string; cache: IdentCache; conf: ConfigRef) = setDefaultLibpath(conf) diff --git a/doc/nimc.rst b/doc/nimc.rst index 31df4b6f7..0682fac03 100644 --- a/doc/nimc.rst +++ b/doc/nimc.rst @@ -154,7 +154,7 @@ passed as a command line argument to the compiler. The ``nim`` executable processes configuration files in the following directories (in this order; later files overwrite previous settings): -1) ``$nim/config/nim.cfg``, ``/etc/nim.cfg`` (UNIX) or ``%NIMROD%/config/nim.cfg`` (Windows). This file can be skipped with the ``--skipCfg`` command line option. +1) ``$nim/config/nim.cfg``, ``/etc/nim/nim.cfg`` (UNIX) or ``%NIM%/config/nim.cfg`` (Windows). This file can be skipped with the ``--skipCfg`` command line option. 2) ``$HOME/.config/nim.cfg`` (POSIX) or ``%APPDATA%/nim.cfg`` (Windows). This file can be skipped with the ``--skipUserCfg`` command line option. 3) ``$parentDir/nim.cfg`` where ``$parentDir`` stands for any parent directory of the project file's path. These files can be skipped with the ``--skipParentCfg`` command line option. 4) ``$projectDir/nim.cfg`` where ``$projectDir`` stands for the project file's path. This file can be skipped with the ``--skipProjCfg`` command line option. |