Skip to content

kaushalmodi/nim_config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Global Nim config

This repo contains my global Nim configuration config.nims (which I place in the $XDG_CONFIG_HOME/nim/ directory.)

Requirement

Needs Nim built from its devel branch (<2018-10-16 Tue>).

List available tasks

nim help

Note that there’s no -- before help.

That will print:

installPcre          Install PCRE using musl-gcc
installLibreSsl      Install LIBRESSL using musl-gcc
installOpenSsl       Install OPENSSL using musl-gcc
strip                Optimize the binary size using 'strip' utility
upx                  Optimize the binary size using 'upx' utility
checksums            Generate checksums of the binary using 'sha1sum' and 'md5sum'
sign                 Sign the binary using 'gpg' (armored, ascii)
encrypt              Encrypt the binary using 'gpg' (compressed, symmetric, ascii)
musl                 Build an optimized static binary using musl
glibc25              Build C, dynamically linked to GLibC 2.5 (x86_64)
js2asm               Build JS, print Assembly from that JS (performance debug)
c2asm                Build C, print Assembly from that C (performance debug)
fmt                  Run nimpretty on all git-managed .nim files in the current repo
rmfiles              Recursively remove all files with the specific extension(s) from the current directory
test                 Run tests via 'nim doc' (runnableExamples) and tests in tests/ dir
docs                 Deploy doc html + search index to public/ directory
runc                 Run equivalent of 'nim c -r ..'
runcpp               Run equivalent of 'nim cpp -r ..'

How to use this

Use in your local projects

  1. Create $XDG_CONFIG_HOME/nim/ directory if it doesn’t already exist (or ~/.config/nim/ if you don’t have XDG_CONFIG_HOME environment variable set).
  2. Download the config.nims and put it in that directory.

Install using Curl:

mkdir --verbose $XDG_CONFIG_HOME/nim/
curl -o $XDG_CONFIG_HOME/nim/config.nims https://raw.githubusercontent.com/kaushalmodi/nim_config/master/config.nims

Uninstall:

rm --verbose $XDG_CONFIG_HOME/nim/config.nims

Use in Travis CI

I use this same file during Nim project builds on Travis CI by including the below in the script: phase:

git clone https://github.com/kaushalmodi/nim_config && cp nim_config/config.nims .
Note
This will overwrite your project-specific config.nims (if any) with the version in this repo. That overwrite happens only in that Travis workspace, but still understand what the above command is doing before using it. *** Using the test and docs tasks

Example use of test and docs tasks

script:
  - nim -v
  - git clone https://github.com/kaushalmodi/nim_config && cp nim_config/config.nims . # Get my global config.nims
  - nim test # The 'test' task is defined in the above retrieved config.nims
  - nim docs # The 'docs' task is defined in the above retrieved config.nims

Source

Example use of musl task

script:
  - cd "${TRAVIS_BUILD_DIR}" # Ensure that you are in repo/build root now.
  - nimble install --depsOnly --accept
  - git clone https://github.com/kaushalmodi/nim_config && cp nim_config/config.nims . # Get my global config.nims
  - nim musl "${NIMFILE}" # The ${NIMFILE} var is defined further up in that .travis.yml

Source

References

About

Global project-agnostic config.nims

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages