Skip to content

Commit

Permalink
Update config.nims search path in docs
Browse files Browse the repository at this point in the history
Related: nim-lang#8682
  • Loading branch information
kaushalmodi committed Oct 16, 2018
1 parent 72cd3b7 commit dab7566
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions doc/nims.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,25 @@ Strictly speaking, ``NimScript`` is the subset of Nim that can be evaluated
by Nim's builtin virtual machine (VM). This VM is used for Nim's compiletime
function evaluation features.

You can use a ``<myproject>.nims`` file that simply contains Nim code
controlling the compilation process. For a directory wide
configuration, use ``config.nims`` instead of ``<myproject>.nims``.
The ``nim`` executable processes the ``.nims`` configuration files in
the following directories (in this order; later files overwrite
previous settings):

1) If environment variable ``XDG_CONFIG_HOME`` is defined,
``$XDG_CONFIG_HOME/nim/config.nims`` or
``~/.config/nim/config.nims`` (POSIX) or
``%APPDATA%/nim/config.nims`` (Windows). This file can be skipped
with the ``--skipUserCfg`` command line option.
2) ``$parentDir/config.nims`` where ``$parentDir`` stands for any
parent directory of the project file's path. These files can be
skipped with the ``--skipParentCfg`` command line option.
3) ``$projectDir/config.nims`` where ``$projectDir`` stands for the
project's path. This file can be skipped with the ``--skipProjCfg``
command line option.
4) A project can also have a project specific configuration file named
``$project.nims`` that resides in the same directory as
``$project.nim``. This file can be skipped with the same
``--skipProjCfg`` command line option.

The VM cannot deal with ``importc`` because the FFI is not
available. So the stdlib modules using ``importc`` cannot be used with
Expand Down

0 comments on commit dab7566

Please sign in to comment.