nim-flakes-lib
Nix flake library to help create Nim package using Nix.
Why
Nix is a package manager, can be used to install any Nix Package like nim, nodejs, python, c libraries, tools, etc (more than 40 000 pkgs).
Nix is also a config language, it can be used to generate our nim.cfg, CI config, documentation, etc, and these configurations could be shared with others as nix packages.
Usage
-
Add it to your inputs.
-
Call the mkRefOutput function from lib
Example:
{
description = "Your flake package description"; # optional
inputs.dsf.url = "github:cruel-intentions/devshell-files"; # optional
inputs.flakeNimbleLib.url = "github:riinr/nim-flakes-lib";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.dsf.inputs.nixpkgs.follows = "nixpkgs"; # optional
inputs.flakeNimbleLib.inputs.nixpkgs.follows = "nixpkgs";
outputs = inputs:
inputs.flakeNimbleLib.lib.mkRefOutput {
nixpkgs = inputs.nixpkgs;
self = inputs.self;
src = ./.; # source could be an input also
meta.ref = "master";
meta.version = "0.1.0";
meta.name = "my_package_name";
meta.desc = "My package description";
}
# optional
# use devshell to configure your dev environment
// # merge objects: `{ a = "a"; } // { b = "b"; }` == `{ a = "a"; b = "b"; }`
(inputs.dsf.lib.shell
inputs
[
${inputs.flakeNimbleLib}/modules/nimcfg-files.nix # helper to create cfg files
./nix/project.nix # your devshell configs
]
);
}
Add this as flake.nix
in your repository then run nix flake show
, it display what packages this libs generates for you.
Currently only defaultPackage
and src
package, but in future we're planning to add musl
and cosmopolitan
packages, and maybe some other archs.
To build defaultPackage
run nix build
, it compiles your project to result/bin/my_package_name
nimcfg
Generates a Nim config file into your project.
FAQ
Why there is no array?
Nix has array but there is no way to define how to disable one item from a array.
Like we can override one attr value with lib.mkDefault, lib.mkForce, lib.mkOverride.
LICENSE NOTICE:
- Descriptions comes from Nim Docs
- Please read Nim copyright
type
attribute set of (submodule)
example
{
nimcfg = {
"/nim.cfg" = {
app = "console";
asm = true;
assertions = true;
backend = "c";
benchmarkVM = false;
boundChecks = true;
cc = "gcc";
checkStyle = false;
checks = true;
cincludes = "DIR";
clearNimblePath = false;
clib = "LIBNAME";
clibdir = "DIR";
colors = true;
compileOnly = false;
cppCompileToNamespace = {
NS = true;
};
cpu = "x86-64";
debugger = "native";
debuginfo = true;
declaredLocs = true;
deepcopy = true;
define = {
defineSomething = "your defined option";
};
defusages = {
FILE,LINE,COL = true;
};
docCmd = "CMD";
docInternal = true;
docRoot = "PATH";
docSeeSrcUrl = "URL";
dynlibOverride = {
SYMBOL = true;
};
dynlibOverrideAll = false;
embedsrc = false;
errorMax = 1;
exceptions = "setjmp";
excessiveStackTrace = false;
excludePath = {
PATH = false;
};
expandArc = {
PROCNAME = true;
};
expandMacro = {
MACRO = true;
};
experimental = {
FEAT = true;
};
fieldChecks = true;
filenames = "abs";
forceBuild = true;
genScript = true;
hint = {
someHint = true;
};
hintAsError = {
someHint = true;
};
hints = true;
hotCodeReloading = false;
implicitStatic = true;
import = {
someImport = true;
};
include = {
someInclude = true;
};
incremental = true;
index = true;
infChecks = true;
legacy = {
FEAT = true;
};
lib = "PATH";
lineDir = true;
lineTrace = true;
listCmd = true;
maxLoopIterationsVM = 100000;
mm = "arc";
multimethods = false;
nanChecks = true;
nimMainPrefix = "PREFIX";
nimblePath = "PATH";
nimcache = "PATH";
noLinking = true;
noMain = true;
noNimblePath = false;
objChecks = true;
opt = "speed";
os = "linux";
out = "FILE";
outdir = "DIR";
overflowChecks = true;
panics = false;
parallelBuild = 4;
passC = "OPTION";
passL = "OPTION";
path = {
somePath = true;
};
processing = "dots";
profileVM = false;
project = true;
putenv = {
someKey = true;
};
rangeChecks = true;
showAllMismatches = false;
sinkInference = true;
skipCfg = false;
skipParentCfg = true;
skipProjCfg = true;
skipUserCfg = true;
spellSuggest = 10;
stackTrace = true;
stackTraceMsgs = false;
stdout = true;
threads = true;
tlsEmulation = false;
trmacros = false;
unitsep = true;
useVersion = "1.2";
usenimcache = true;
verbosity = 3;
warning = {
someWarning = true;
};
warningAsError = {
someWarning = true;
};
warnings = true;
};
};
}
default
{
nimcfg = {};
}
nimcfg.<name>.FOOTER
Insert this at end of cfg file
type
null or strings concatenated with "\n"
example
{
nimcfg.<name>.FOOTER = "# IM your FOOTER";
}
default
{
nimcfg.<name>.FOOTER = "";
}
nimcfg.<name>.HEADER
Insert this at begin of cfg file
type
null or strings concatenated with "\n"
example
{
nimcfg.<name>.HEADER = "# IM your HEADER";
}
default
{
nimcfg.<name>.HEADER = "";
}
nimcfg.<name>.NimblePath
add a PATH for Nimble support
type
attribute set of boolean
example
{
nimcfg.<name>.NimblePath = {
X = true;
};
}
default
{
nimcfg.<name>.NimblePath = {};
}
nimcfg.<name>.app
generate a CONSOLE app|GUI app|DLL|STATIC library
type
null or one of "console", "gui", "lib", "staticlib"
example
{
nimcfg.<name>.app = "gui";
}
default
{
nimcfg.<name>.app = null;
}
nimcfg.<name>.asm
produce assembler code
type
null or boolean
example
{
nimcfg.<name>.asm = true;
}
default
{
nimcfg.<name>.asm = null;
}
nimcfg.<name>.assertions
turn assertions on|off
type
null or boolean
example
{
nimcfg.<name>.assertions = true;
}
default
{
nimcfg.<name>.assertions = null;
}
nimcfg.<name>.backend
sets backend to use with commands like nim doc or nim r
type
null or one of "c", "cpp", "js", "objc"
example
{
nimcfg.<name>.backend = "js";
}
default
{
nimcfg.<name>.backend = null;
}
nimcfg.<name>.benchmarkVM
turn benchmarking of VM code with cpuTime() on|off
type
null or boolean
example
{
nimcfg.<name>.benchmarkVM = true;
}
default
{
nimcfg.<name>.benchmarkVM = null;
}
nimcfg.<name>.boundChecks
turn bound checks on|off
type
null or boolean
example
{
nimcfg.<name>.boundChecks = true;
}
default
{
nimcfg.<name>.boundChecks = null;
}
nimcfg.<name>.cc
SYMBOL: specify the C compiler
type
null or string
example
{
nimcfg.<name>.cc = "gcc";
}
default
{
nimcfg.<name>.cc = null;
}
nimcfg.<name>.checks
turn all runtime checks on|off
type
null or boolean
example
{
nimcfg.<name>.checks = true;
}
default
{
nimcfg.<name>.checks = null;
}
nimcfg.<name>.cincludes
modify the C compiler header search PATH
type
attribute set of boolean
example
{
nimcfg.<name>.cincludes = {
X = true;
};
}
default
{
nimcfg.<name>.cincludes = {};
}
nimcfg.<name>.clearNimblePath
empty the list of Nimble package search paths
type
null or boolean
example
{
nimcfg.<name>.clearNimblePath = true;
}
default
{
nimcfg.<name>.clearNimblePath = null;
}
nimcfg.<name>.clib
link an additional C LIBRARY (you should omit platform-specific extensions)
type
attribute set of boolean
example
{
nimcfg.<name>.clib = {
X = true;
};
}
default
{
nimcfg.<name>.clib = {};
}
nimcfg.<name>.clibdir
modify the linker library search PATH
type
attribute set of boolean
example
{
nimcfg.<name>.clibdir = {
X = true;
};
}
default
{
nimcfg.<name>.clibdir = {};
}
nimcfg.<name>.colors
turn compiler messages coloring on|off
type
null or boolean
example
{
nimcfg.<name>.colors = true;
}
default
{
nimcfg.<name>.colors = null;
}
nimcfg.<name>.compileOnly
compile Nim files only; do not assemble or link
type
null or boolean
example
{
nimcfg.<name>.compileOnly = true;
}
default
{
nimcfg.<name>.compileOnly = null;
}
nimcfg.<name>.cppCompileToNamespace
use the provided NAMESPACE for the generated C++ code, if no namespace is provided "Nim" will be used
type
attribute set of boolean
example
{
nimcfg.<name>.cppCompileToNamespace = {
X = true;
};
}
default
{
nimcfg.<name>.cppCompileToNamespace = {};
}
nimcfg.<name>.cpu
SYMBOL: set the target processor (cross-compilation)
type
null or string
example
{
nimcfg.<name>.cpu = "x86-64";
}
default
{
nimcfg.<name>.cpu = null;
}
nimcfg.<name>.debugger
use native debugger (gdb)
type
null or value "native" (singular enum)
example
{
nimcfg.<name>.debugger = "native";
}
default
{
nimcfg.<name>.debugger = null;
}
nimcfg.<name>.debuginfo
enables debug information
type
null or boolean
example
{
nimcfg.<name>.debuginfo = true;
}
default
{
nimcfg.<name>.debuginfo = null;
}
nimcfg.<name>.declaredLocs
show declaration locations in messages
type
null or boolean
example
{
nimcfg.<name>.declaredLocs = true;
}
default
{
nimcfg.<name>.declaredLocs = null;
}
nimcfg.<name>.deepcopy
enable 'system.deepCopy' for --mm:arc|orc
type
null or boolean
example
{
nimcfg.<name>.deepcopy = true;
}
default
{
nimcfg.<name>.deepcopy = null;
}
nimcfg.<name>.define
Define a conditional symbol
Optionally: Define the value for that symbol, see compile time define pragmas.
Unlike other symbols that follow identifier equality of nim, define sysymbols are full case insensitive.
Example:
All defined will match with -d:A_B
when defined aB:
echo "aB"
when defined Ab:
echo "Ab"
when defined a_b:
echo "a_b"
Some define
options
This is a list of some define options found in Nim/Nim stdlib source code.
Look at your dependency documentation to check if they define theirs own or require some of them.
And some of them should be compiler paramaters.
ie:
-d:consoleapp
should be--app:console
-d:linux
should be--os:linux
Most common:
- release (for a release build)
- ssl (activate SSL sockets/HTTPS)
- mingw (cross compile for windows)
Hardware:
- avr
- amd64
- arm
- arm64
- atari
- cpu16
- cpu32
- cpu64
- e2k
- hppa
- hp9000
- hp9000s300
- hp9000s700
- hp9000s800
- hp9000s820
- i386
- ia64
- loongarch64
- m68k
- mips
- mips64
- mips64el
- mipsel
- msp430
- nintendoswitch
- parisc
- powerpc
- powerpc64
- powerpc64el
- riscv32
- riscv64
- sparc
- sparc64
- sparcv9
- x86
- wasm
- wasm32
Arch Related
- nimPinToCpu
OS:
- aix
- amiga
- alpha
- android
- android4
- bsd
- dmc
- dos
- dragonfly
- freebsd
- freertos
- genode
- haiku
- hpux
- ios
- irix
- linux
- macos
- macosx
- morphos
- netbsd
- netware
- openbsd
- os2
- osx
- palmos
- posix
- qnx
- riscos
- standalone
- skyos
- solaris
- sunos
- unix
- windows
- zephyr
- vxworks
OS Related
- kqcache (BSD)
- SocketMaxConnections = 32 (freertos)
Compillers:
- bcc
- clang
- clangcl
- gcc
- icc
- icl
- llvm_gcc
- tcc
- vcc
- wcc
Languages
- c
- cpp
- js
- nimscript
Lang Related
- booting
- consoleapp
- guiapp
- kwin
- nimJsMathTruncPolyfill
- nimJsonGet
- nimLegacyJsRound
- nimble
- nimconfig
- nimdoc
- nimsuggest
- noCppExceptions
- nodejs
- vm
Lib C
- emscripten
- nimNoLibc
- uClibc
Lib Related
- lwip
- lwip6
- nimNetLite
- ODBCVER
- staticSqlite
- usePcreHeader
- nimExperimentalLinenoiseExtra
SSL
- ssl
- libressl
SSL Related
- openssl10
- sslVersion = ""
- useOpenssl3 = sslVersion.startsWith('3')
- noOpenSSLHacks
- nimDisableCertificateValidation
- nimTlsSize = 16000
Memory Management
- boehmgc
- boehmNoIntPtr
- gcArc
- gcOrc
- gogc
- nogc
MM Related
- builtinOverflow
- gcDestructors
- gcHooks
- gcMarkAndSweep
- gcRegions
- gcUseBitvectors
- ignoreAllocationSize
- logGC
- memProfiler
- memtracker (memTracker)
- nimAlignPragma
- nimAllocNoUnmap
- nimAllocPagesViaMalloc
- nimAllocStats
- nimArcDebug
- nimArcIds
- nimEmulateOverflowChecks
- nimFixedOrc
- nimFixedOwned
- nimHasLentIterators
- nimHasSinkInference
- nimLeakDetector
- nimMaxHeap = 0
- nimMemAlignTiny
- nimMinHeapPages = 128
- nimMinHeapPages = 4
- nimNoAllocForSSL
- nimNoLentIterators
- nimOwnedEnabled
- nimPage1k
- nimPage256
- nimPage512
- nimStressOrc
- sizeofInt128
- StandaloneHeapSize = 1024 * PageSize
- traceArc
- useGcAssert
- useMalloc
- useRealtimeGC
- zephyrUseLibcMalloc
Threads
- threadsafe
- MaxDistinguishedThread = 32
- MaxThreadPoolSize = 256
- nimThreadStackGuard = 128
- nimThreadStackSize = 8192
- threadpoolWaitMs = 100
Debug
- androidNDK
- debugFmtDsl
- debugHeapLinks
- debugScanp
- futureLogging
- hotcodereloading
- hotCodeReloading
- nativeStacktrace
- nativeStackTrace
- nimAuditDelete
- nimDebugDlOpen
- nimDoesntTrackDefects
- nimDumpAsync
- nimFulldebug
- nimQuirky
- nimTracing
- nimTrMacros
- nimStackTraceOverride
- nimTasksDebug
- profiler
- testing
- testNimHcr
- traceHcr
Others
- avlcorruption and nimAvlcorruption
- createNimHcr
- createNimRtl
- nimCallDepthLimit = 2000
- globalSymbols
- net_ipv4
- net_ipv6
- net_raw
- nimBuiltinSetjmp
- nimCoroutines
- nimCoroutinesSetjmp
- nimCoroutinesSetjmpBundled
- nimCoroutinesUcontext
- nimCorruption
- nimCycleBreaker
- nimDontSetUtf8CodePage
- nimFixedForwardGeneric
- nimHasCallsitePragma
- nimHasCursor
- nimHasDeclaredMagic
- nimHasEffectsOf
- nimHasEnforceNoRaises
- nimHasExceptionsQuery
- nimHasInvariant
- nimHasIsNamedTuple
- nimHasIterable
- nimHasOutParams
- nimHasStacktraceMsgs
- nimHasStyleChecks
- nimHasTemplateRedefinitionPragma
- nimHasTopDownInference
- nimHasTrace
- nimHasUsed
- nimHasWorkaround14720
- nimHashOrdinalFixed
- nimIcIntegrityChecks
- nimImportutilsExample
- nimInheritHandles
- nimIntHash1
- nimLagacyOptionsDollar
- nimLegacyCopyFile
- nimLegacyMacrosCollapseSymChoice
- nimLegacyParseQueryStrict
- nimLegacyRandomInitRand
- nimLegacySigpipeHandler
- nimMacrosGetNodeId
- nimMaxDescriptorsFallback = 16000 (asynchttpserver)
- nimNewIntegerOps
- nimNewShared
- nimNoArrayToString
- nimNoGetRandom
- nimNoQuit
- nimNoZeroExtendMagic
- nimOldCaseObjects
- nimOldDlls
- nimOldEcho
- nimOldRelativePathBehavior
- nimOldShiftRight
- nimOptimizedSplitChunk
- nimPanics
- nimPollHasEventFds
- nimPreviewFloatRoundtrip
- nimPreviewHashRef
- nimPreviewJsonutilsHoleyEnum
- nimPreviewSlimSystem
- nimRawSetjmp
- nimRecursiveSpawn
- nimSeqsV2
- nimShallowStrings
- nimSigSetjmp
- nimSmokeCycles
- nimStdSetjmp
- nimStrictDelete
- nimSymImplTransform
- nimTempPathLength = 8
- nimThinout
- nimToOpenArrayCString
- nimTypeNames
- nimUnittestAbortOnError
- nimUnittestOutputLevel = "..."
- nimUnittestColor = "auto" (auto|on|off)
- nimUse64BitCTime
- nimV2
- nimfix
- noIntrinsicsBitOpts
- noNimCoroutines
- noSignalHandler
- noUndefinedBitOpts
- noUnidecodeTable
- posixRealtime
- reportMissedDeadlines
- tempDir = "..."
- useClone
- useFork
- useNimRtl
- useShPath = "..."
- useStdoutAsStdmsg
- useSysAssert
- useWinAnsi
type
attribute set of (boolean or signed integer or string)
example
{
nimcfg.<name>.define = {
X = "some value";
Y = true;
Z = 42;
logGC = true;
ssl = true;
};
}
default
{
nimcfg.<name>.define = {};
}
nimcfg.<name>.defusages
find the definition and all usages of a symbol
type
attribute set of boolean
example
{
nimcfg.<name>.defusages = {
X = true;
};
}
default
{
nimcfg.<name>.defusages = {};
}
nimcfg.<name>.docCmd
CMD: if cmd eq skip, skips runnableExamples else, runs runnableExamples with given options
type
null or string
example
{
nimcfg.<name>.docCmd = "-d:foo --threads:on";
}
default
{
nimcfg.<name>.docCmd = null;
}
nimcfg.<name>.docInternal
also generate documentation for non-exported symbols
type
null or boolean
example
{
nimcfg.<name>.docInternal = true;
}
default
{
nimcfg.<name>.docInternal = null;
}
nimcfg.<name>.docRoot
PATH: nim doc --docRoot:/foo --project --outdir:docs /foo/sub/main.nim generates: docs/sub/main.html if path eq @pkg, will use nimble file enclosing dir if path eq @path, will use first matching dir in --path if path eq @default (the default and most useful), will use best match among @pkg,@path. if these are nonexistent, will use project path
type
null or string
example
{
nimcfg.<name>.docRoot = "/foot";
}
default
{
nimcfg.<name>.docRoot = null;
}
nimcfg.<name>.docSeeSrcUrl
URL: activate 'see source' for doc command (see doc.item.seesrc in config/nimdoc.cfg)
type
null or string
example
{
nimcfg.<name>.docSeeSrcUrl = "https://github.com/riinr/nim-flake-lib/";
}
default
{
nimcfg.<name>.docSeeSrcUrl = null;
}
nimcfg.<name>.dynlibOverride
marks SYMBOL so that dynlib:SYMBOL has no effect and can be statically linked instead; symbol matching is fuzzy so that --dynlibOverride:lua matches dynlib: "liblua.so.3"
type
attribute set of boolean
example
{
nimcfg.<name>.dynlibOverride = {
X = true;
};
}
default
{
nimcfg.<name>.dynlibOverride = {};
}
nimcfg.<name>.dynlibOverrideAll
disables the effects of the dynlib pragma
type
null or boolean
example
{
nimcfg.<name>.dynlibOverrideAll = true;
}
default
{
nimcfg.<name>.dynlibOverrideAll = null;
}
nimcfg.<name>.embedsrc
embeds the original source code as comments in the generated output
type
null or boolean
example
{
nimcfg.<name>.embedsrc = true;
}
default
{
nimcfg.<name>.embedsrc = null;
}
nimcfg.<name>.errorMax
stop compilation after N errors; 0 means unlimited
type
null or unsigned integer, meaning >=0
example
{
nimcfg.<name>.errorMax = 4;
}
default
{
nimcfg.<name>.errorMax = null;
}
nimcfg.<name>.exceptions
select the exception handling implementation
type
null or one of "setjmp", "cpp", "goto", "quirky"
example
{
nimcfg.<name>.exceptions = "setjmp";
}
default
{
nimcfg.<name>.exceptions = null;
}
nimcfg.<name>.excessiveStackTrace
stack traces use full file paths
type
null or boolean
example
{
nimcfg.<name>.excessiveStackTrace = true;
}
default
{
nimcfg.<name>.excessiveStackTrace = null;
}
nimcfg.<name>.excludePath
exclude a PATH from the list of search paths
type
attribute set of boolean
example
{
nimcfg.<name>.excludePath = {
X = true;
};
}
default
{
nimcfg.<name>.excludePath = {};
}
nimcfg.<name>.expandArc
show how PROCNAME looks like after diverse optimizations before the final backend phase (mostly ARC/ORC specific)
type
attribute set of boolean
example
{
nimcfg.<name>.expandArc = {
X = true;
};
}
default
{
nimcfg.<name>.expandArc = {};
}
nimcfg.<name>.expandMacro
dump every generated AST from MACRO
type
attribute set of boolean
example
{
nimcfg.<name>.expandMacro = {
X = true;
};
}
default
{
nimcfg.<name>.expandMacro = {};
}
nimcfg.<name>.experimental
enable experimental language FEATURE
type
attribute set of boolean
example
{
nimcfg.<name>.experimental = {
X = true;
};
}
default
{
nimcfg.<name>.experimental = {};
}
nimcfg.<name>.fieldChecks
turn case variant field checks on|off
type
null or boolean
example
{
nimcfg.<name>.fieldChecks = true;
}
default
{
nimcfg.<name>.fieldChecks = null;
}
nimcfg.<name>.filenames
customize how filenames are rendered in compiler messages, defaults to abs (absolute)
type
null or one of "abs", "canonical", "legacyRelProj"
example
{
nimcfg.<name>.filenames = "abs";
}
default
{
nimcfg.<name>.filenames = null;
}
nimcfg.<name>.floatChecks
turn all floating point (NaN/Inf) checks on|off
type
null or boolean
example
{
nimcfg.<name>.floatChecks = true;
}
default
{
nimcfg.<name>.floatChecks = null;
}
nimcfg.<name>.forceBuild
force rebuilding of all modules
type
null or boolean
example
{
nimcfg.<name>.forceBuild = true;
}
default
{
nimcfg.<name>.forceBuild = null;
}
nimcfg.<name>.genScript
generate a compile script (in the 'nimcache' subdirectory named 'compile_$$project$$scriptext'), and a '.deps' file containing the dependencies; implies --compileOnly
type
null or boolean
example
{
nimcfg.<name>.genScript = true;
}
default
{
nimcfg.<name>.genScript = null;
}
nimcfg.<name>.hint
turn specific HINT X on|off. hint:X means hint:X:on, as with similar flags. all is the set of all hints (only all:off is supported).
type
attribute set of boolean
example
{
nimcfg.<name>.hint = {
X = true;
};
}
default
{
nimcfg.<name>.hint = {};
}
nimcfg.<name>.hintAsError
turn specific HINT X into an error on|off
type
attribute set of boolean
example
{
nimcfg.<name>.hintAsError = {
X = true;
};
}
default
{
nimcfg.<name>.hintAsError = {};
}
nimcfg.<name>.hints
on|off enables or disables hints. list reports which hints are selected.
type
null or boolean
example
{
nimcfg.<name>.hints = true;
}
default
{
nimcfg.<name>.hints = null;
}
nimcfg.<name>.hotCodeReloading
turn support for hot code reloading on|off
type
null or boolean
example
{
nimcfg.<name>.hotCodeReloading = true;
}
default
{
nimcfg.<name>.hotCodeReloading = null;
}
nimcfg.<name>.implicitStatic
turn implicit compile time evaluation on|off
type
null or boolean
example
{
nimcfg.<name>.implicitStatic = true;
}
default
{
nimcfg.<name>.implicitStatic = null;
}
nimcfg.<name>.import
add an automatically imported MODULE see also patchFile in nimscript which offers more flexibility.
type
attribute set of boolean
example
{
nimcfg.<name>.import = {
X = true;
};
}
default
{
nimcfg.<name>.import = {};
}
nimcfg.<name>.include
add an automatically included MODULE
type
attribute set of boolean
example
{
nimcfg.<name>.include = {
X = true;
};
}
default
{
nimcfg.<name>.include = {};
}
nimcfg.<name>.incremental
only recompile the changed modules (experimental!)
type
null or boolean
example
{
nimcfg.<name>.incremental = true;
}
default
{
nimcfg.<name>.incremental = null;
}
nimcfg.<name>.index
turn index file generation on|off
type
null or boolean
example
{
nimcfg.<name>.index = true;
}
default
{
nimcfg.<name>.index = null;
}
nimcfg.<name>.infChecks
turn Inf checks on|off
type
null or boolean
example
{
nimcfg.<name>.infChecks = true;
}
default
{
nimcfg.<name>.infChecks = null;
}
nimcfg.<name>.legacy
enable obsolete/legacy language FEATURE
type
attribute set of boolean
example
{
nimcfg.<name>.legacy = {
X = true;
};
}
default
{
nimcfg.<name>.legacy = {};
}
nimcfg.<name>.lib
PATH: set the system library path
type
null or string
example
{
nimcfg.<name>.lib = "./my_nim";
}
default
{
nimcfg.<name>.lib = null;
}
nimcfg.<name>.lineDir
generation of #line directive on|off
type
null or boolean
example
{
nimcfg.<name>.lineDir = true;
}
default
{
nimcfg.<name>.lineDir = null;
}
nimcfg.<name>.lineTrace
turn line tracing on|off
type
null or boolean
example
{
nimcfg.<name>.lineTrace = true;
}
default
{
nimcfg.<name>.lineTrace = null;
}
nimcfg.<name>.listCmd
list the compilation commands; can be combined with --hint:exec:on and --hint:link:on
type
null or boolean
example
{
nimcfg.<name>.listCmd = true;
}
default
{
nimcfg.<name>.listCmd = null;
}
nimcfg.<name>.maxLoopIterationsVM
set max iterations for all VM loops
type
null or positive integer, meaning >0
example
{
nimcfg.<name>.maxLoopIterationsVM = 10000;
}
default
{
nimcfg.<name>.maxLoopIterationsVM = null;
}
nimcfg.<name>.mm
select which memory management to use; default is 'refc' recommended is 'orc'
type
null or one of "orc", "arc", "refc", "markAndSweep", "boehm", "go", "none", "regions"
example
{
nimcfg.<name>.mm = "orc";
}
default
{
nimcfg.<name>.mm = null;
}
nimcfg.<name>.multimethods
turn multi-methods on|off
type
null or boolean
example
{
nimcfg.<name>.multimethods = true;
}
default
{
nimcfg.<name>.multimethods = null;
}
nimcfg.<name>.nanChecks
turn NaN checks on|off
type
null or boolean
example
{
nimcfg.<name>.nanChecks = true;
}
default
{
nimcfg.<name>.nanChecks = null;
}
nimcfg.<name>.nimMainPrefix
PREFIX: use {prefix}NimMain instead of NimMain in the produced C/C++ code
type
null or string
example
{
nimcfg.<name>.nimMainPrefix = "nim_c_";
}
default
{
nimcfg.<name>.nimMainPrefix = null;
}
nimcfg.<name>.nimcache
PATH: set the path used for generated files see also
type
null or string
example
{
nimcfg.<name>.nimcache = "./cache";
}
default
{
nimcfg.<name>.nimcache = null;
}
nimcfg.<name>.noLinking
compile Nim and generated files but do not link
type
null or boolean
example
{
nimcfg.<name>.noLinking = true;
}
default
{
nimcfg.<name>.noLinking = null;
}
nimcfg.<name>.noMain
do not generate a main procedure
type
null or boolean
example
{
nimcfg.<name>.noMain = true;
}
default
{
nimcfg.<name>.noMain = null;
}
nimcfg.<name>.noNimblePath
deactivate the Nimble path
type
null or boolean
example
{
nimcfg.<name>.noNimblePath = true;
}
default
{
nimcfg.<name>.noNimblePath = null;
}
nimcfg.<name>.objChecks
turn obj conversion checks on|off
type
null or boolean
example
{
nimcfg.<name>.objChecks = true;
}
default
{
nimcfg.<name>.objChecks = null;
}
nimcfg.<name>.opt
optimize not at all or for speed|size Note: use -d:release for a release build!
type
null or one of "none", "speed", "size"
example
{
nimcfg.<name>.opt = "speed";
}
default
{
nimcfg.<name>.opt = null;
}
nimcfg.<name>.os
SYMBOL: set the target operating system (cross-compilation)
type
null or string
example
{
nimcfg.<name>.os = "linux";
}
default
{
nimcfg.<name>.os = null;
}
nimcfg.<name>.out
FILE: set the output filename
type
null or string
example
{
nimcfg.<name>.out = "my_bin";
}
default
{
nimcfg.<name>.out = null;
}
nimcfg.<name>.outdir
DIR: set the path where the output file will be written
type
null or string
example
{
nimcfg.<name>.outdir = "./bin";
}
default
{
nimcfg.<name>.outdir = null;
}
nimcfg.<name>.overflowChecks
turn int over-/underflow checks on|off
type
null or boolean
example
{
nimcfg.<name>.overflowChecks = true;
}
default
{
nimcfg.<name>.overflowChecks = null;
}
nimcfg.<name>.panics
turn panics into process terminations (default: off)
type
null or boolean
example
{
nimcfg.<name>.panics = true;
}
default
{
nimcfg.<name>.panics = null;
}
nimcfg.<name>.parallelBuild
perform a parallel build value = number of processors (0 for auto-detect)
type
null or unsigned integer, meaning >=0
example
{
nimcfg.<name>.parallelBuild = 4;
}
default
{
nimcfg.<name>.parallelBuild = null;
}
nimcfg.<name>.passC
OPTION: pass an option to the C compiler
type
null or strings concatenated with "\n"
example
{
nimcfg.<name>.passC = "-flto";
}
default
{
nimcfg.<name>.passC = null;
}
nimcfg.<name>.passL
OPTION: pass an option to the linker
type
null or strings concatenated with "\n"
example
{
nimcfg.<name>.passL = "-flto";
}
default
{
nimcfg.<name>.passL = null;
}
nimcfg.<name>.path
add PATH to search paths
type
attribute set of boolean
example
{
nimcfg.<name>.path = {
X = true;
};
}
default
{
nimcfg.<name>.path = {};
}
nimcfg.<name>.processing
show files as they're being processed by nim compiler
type
null or one of "dots", "filenames", "off"
example
{
nimcfg.<name>.processing = "filenames";
}
default
{
nimcfg.<name>.processing = null;
}
nimcfg.<name>.profileVM
turn compile time VM profiler on|off
type
null or boolean
example
{
nimcfg.<name>.profileVM = true;
}
default
{
nimcfg.<name>.profileVM = null;
}
nimcfg.<name>.project
document the whole project (doc)
type
null or boolean
example
{
nimcfg.<name>.project = true;
}
default
{
nimcfg.<name>.project = null;
}
nimcfg.<name>.putenv
set an environment variable
type
attribute set of string
example
{
nimcfg.<name>.putenv = {
LANG = "en_US.UTF-8";
X = "some value";
};
}
default
{
nimcfg.<name>.putenv = {};
}
nimcfg.<name>.rangeChecks
turn range checks on|off
type
null or boolean
example
{
nimcfg.<name>.rangeChecks = true;
}
default
{
nimcfg.<name>.rangeChecks = null;
}
nimcfg.<name>.showAllMismatches
show all mismatching candidates in overloading resolution
type
null or boolean
example
{
nimcfg.<name>.showAllMismatches = true;
}
default
{
nimcfg.<name>.showAllMismatches = null;
}
nimcfg.<name>.sinkInference
turn sink parameter inference on|off (default: on)
type
null or boolean
example
{
nimcfg.<name>.sinkInference = true;
}
default
{
nimcfg.<name>.sinkInference = null;
}
nimcfg.<name>.skipCfg
do not read the nim installation's configuration file
type
null or boolean
example
{
nimcfg.<name>.skipCfg = true;
}
default
{
nimcfg.<name>.skipCfg = null;
}
nimcfg.<name>.skipParentCfg
do not read the parent dirs' configuration files
type
null or boolean
example
{
nimcfg.<name>.skipParentCfg = true;
}
default
{
nimcfg.<name>.skipParentCfg = null;
}
nimcfg.<name>.skipProjCfg
do not read the project's configuration file
type
null or boolean
example
{
nimcfg.<name>.skipProjCfg = true;
}
default
{
nimcfg.<name>.skipProjCfg = null;
}
nimcfg.<name>.skipUserCfg
do not read the user's configuration file
type
null or boolean
example
{
nimcfg.<name>.skipUserCfg = true;
}
default
{
nimcfg.<name>.skipUserCfg = null;
}
nimcfg.<name>.spellSuggest
show at most num >= 0 spelling suggestions on typos. if num is not specified (or auto), return an implementation defined set of suggestions.
type
null or positive integer, meaning >0
example
{
nimcfg.<name>.spellSuggest = 10;
}
default
{
nimcfg.<name>.spellSuggest = null;
}
nimcfg.<name>.stackTrace
turn stack tracing on|off
type
null or boolean
example
{
nimcfg.<name>.stackTrace = true;
}
default
{
nimcfg.<name>.stackTrace = null;
}
nimcfg.<name>.stackTraceMsgs
enable user defined stack frame msgs via setFrameMsg
type
null or boolean
example
{
nimcfg.<name>.stackTraceMsgs = true;
}
default
{
nimcfg.<name>.stackTraceMsgs = null;
}
nimcfg.<name>.stdout
output to stdout
type
null or boolean
example
{
nimcfg.<name>.stdout = true;
}
default
{
nimcfg.<name>.stdout = null;
}
nimcfg.<name>.styleCheck
produce hints or errors for Nim identifiers that do not adhere to Nim's official style guide. styleCheck:usages - only enforce consistent spellings of identifiers, do not enforce the style on declarations
type
null or one of "off", "hint", "error", "usages"
example
{
nimcfg.<name>.styleCheck = "hint";
}
default
{
nimcfg.<name>.styleCheck = null;
}
nimcfg.<name>.threads
turn support for multi-threading on|off
type
null or boolean
example
{
nimcfg.<name>.threads = true;
}
default
{
nimcfg.<name>.threads = null;
}
nimcfg.<name>.tlsEmulation
turn thread local storage emulation on|off
type
null or boolean
example
{
nimcfg.<name>.tlsEmulation = true;
}
default
{
nimcfg.<name>.tlsEmulation = null;
}
nimcfg.<name>.trmacros
turn term rewriting macros on|off
type
null or boolean
example
{
nimcfg.<name>.trmacros = true;
}
default
{
nimcfg.<name>.trmacros = null;
}
nimcfg.<name>.undef
undefine a conditional SYMBOL
type
attribute set of boolean
example
{
nimcfg.<name>.undef = {
X = true;
};
}
default
{
nimcfg.<name>.undef = {};
}
nimcfg.<name>.unitsep
use the ASCII unit separator (31) between error messages, useful for IDE-like tooling
type
null or boolean
example
{
nimcfg.<name>.unitsep = true;
}
default
{
nimcfg.<name>.unitsep = null;
}
nimcfg.<name>.useVersion
emulate Nim version X of the Nim compiler, for testing
type
null or one of "1.0", "1.2"
example
{
nimcfg.<name>.useVersion = "1.2";
}
default
{
nimcfg.<name>.useVersion = null;
}
nimcfg.<name>.usenimcache
will use $$nimcache, whichever it resolves to after all options have been processed
type
null or boolean
example
{
nimcfg.<name>.usenimcache = true;
}
default
{
nimcfg.<name>.usenimcache = null;
}
nimcfg.<name>.verbosity
set Nim's verbosity level (1 is default)
type
null or one of 0, 1, 2, 3
example
{
nimcfg.<name>.verbosity = 3;
}
default
{
nimcfg.<name>.verbosity = null;
}
nimcfg.<name>.warning
turn on|off WARNING
type
attribute set of boolean
example
{
nimcfg.<name>.warning = {
X = true;
};
}
default
{
nimcfg.<name>.warning = {};
}
nimcfg.<name>.warningAsError
turn some WARNING in ERROR
type
attribute set of boolean
example
{
nimcfg.<name>.warningAsError = {
X = true;
};
}
default
{
nimcfg.<name>.warningAsError = {};
}
nimcfg.<name>.warnings
same as --hints but for warnings.
type
null or boolean
example
{
nimcfg.<name>.warnings = true;
}
default
{
nimcfg.<name>.warnings = null;
}
nimpkg
Setup Nim packages
type
attribute set of (submodule)
example
{
nimpkg = {
yourPkgName-default = {
cmd = "build";
default = true;
opts = {
define = {
ssl = true;
};
threads = true;
};
version = "0.1.0";
};
};
}
default
{
nimpkg = {};
}
nimpkg.<name>.cmd
package compile command
type
one of "build", "run", "e", "c", "cpp", "objc", "js", "check", "test", "doc", "lock", "rst2html", "rst2tex", "doc2tex", "jsondoc", "ctags", "buildIndex", "genDepend", "dump"
example
{
nimpkg.<name>.cmd = "c";
}
default
{
nimpkg.<name>.cmd = "build";
}
nimpkg.<name>.default
make this package default for flake
type
boolean
example
{
nimpkg.<name>.default = true;
}
default
{
nimpkg.<name>.default = false;
}
nimpkg.<name>.deps
Nim libraries, c headers or executables needed to compile
type
list of package
example
{
nimpkg.<name>.deps = [
"zerofunctional"
"muslc"
"libressl"
"gcc"
"binutils"
"upx"
];
}
default
{
nimpkg.<name>.deps = [];
}
nimpkg.<name>.file
file to be compiled
type
null or path
example
{
nimpkg.<name>.file = "src/bla.nim";
}
default
{
nimpkg.<name>.file = null;
}
nimpkg.<name>.meta
type
submodule
example
{
nimpkg.<name>.meta = {
homepage = "https://github.com/riinr/nim-flakes-lib";
license = "mit";
};
}
default
{
nimpkg.<name>.meta = {};
}
nimpkg.<name>.meta.description
package description
type
null or string
example
{
nimpkg.<name>.meta.description = "my package description";
}
default
{
nimpkg.<name>.meta.description = null;
}
nimpkg.<name>.meta.homepage
Package Home Page
type
null or string
example
{
nimpkg.<name>.meta.homepage = "https://github.com/riinr/nim-flakes-lib";
}
default
{
nimpkg.<name>.meta.homepage = null;
}
nimpkg.<name>.meta.license
Package License
type
null or one of "abstyles", "afl20", "afl21", "afl3", "agpl3", "agpl3Only", "agpl3Plus", "aladdin", "amazonsl", "amd", "aom", "apsl10", "apsl20", "arphicpl", "artistic1", "artistic2", "asl20", "beerware", "bitstreamVera", "blueOak100", "bola11", "boost", "bsd0", "bsd1", "bsd2", "bsd2Patent", "bsd3", "bsdOriginal", "bsdOriginalShortened", "bsdOriginalUC", "bsdProtection", "bsl11", "cal10", "capec", "cc-by-30", "cc-by-40", "cc-by-nc-30", "cc-by-nc-40", "cc-by-nc-sa-20", "cc-by-nc-sa-25", "cc-by-nc-sa-30", "cc-by-nc-sa-40", "cc-by-nd-30", "cc-by-sa-25", "cc-by-sa-30", "cc-by-sa-40", "cc0", "cddl", "cecill-b", "cecill-c", "cecill20", "cecill21", "clArtistic", "cpal10", "cpl10", "curl", "databricks", "databricks-dbx", "doc", "drl10", "eapl", "efl10", "efl20", "elastic", "epl10", "epl20", "epson", "eupl11", "eupl12", "fdl11", "fdl11Only", "fdl11Plus", "fdl12", "fdl12Only", "fdl12Plus", "fdl13", "fdl13Only", "fdl13Plus", "ffsl", "free", "ftl", "g4sl", "generaluser", "geogebra", "gpl1Only", "gpl1Plus", "gpl2", "gpl2Classpath", "gpl2ClasspathPlus", "gpl2Only", "gpl2Oss", "gpl2Plus", "gpl3", "gpl3ClasspathPlus", "gpl3Only", "gpl3Plus", "hpnd", "hpndSellVariant", "iasl", "ijg", "imagemagick", "imlib2", "inria-compcert", "inria-icesl", "ipa", "ipl10", "isc", "issl", "lal12", "lal13", "lgpl2", "lgpl21", "lgpl21Only", "lgpl21Plus", "lgpl2Only", "lgpl2Plus", "lgpl3", "lgpl3Only", "lgpl3Plus", "lgpllr", "libpng", "libpng2", "libssh2", "libtiff", "llgpl21", "llvm-exception", "lpl-102", "lppl12", "lppl13c", "miros", "mit", "mit-feh", "mit0", "mitAdvertising", "mpl10", "mpl11", "mpl20", "mspl", "nasa13", "ncsa", "nposl3", "obsidian", "ocamlpro_nc", "odbl", "ofl", "oml", "openldap", "openssl", "osl2", "osl21", "osl3", "parity70", "php301", "postgresql", "postman", "prosperity30", "psfl", "publicDomain", "purdueBsd", "qhull", "qpl", "qwt", "ruby", "sendmail", "sgi-b-20", "sleepycat", "smail", "sspl", "stk", "tcltk", "ucd", "ufl", "unfree", "unfreeRedistributable", "unfreeRedistributableFirmware", "unicode-dfs-2015", "unicode-dfs-2016", "unlicense", "upl", "vim", "virtualbox-puel", "vol-sl", "vsl10", "w3c", "wadalab", "watcom", "wtfpl", "wxWindows", "xfig", "zlib", "zpl20", "zpl21"
example
{
nimpkg.<name>.meta.license = "mit";
}
default
{
nimpkg.<name>.meta.license = null;
}
nimpkg.<name>.meta.longDescription
package long description
type
null or strings concatenated with "\n"
example
{
nimpkg.<name>.meta.longDescription = "my package long description";
}
default
{
nimpkg.<name>.meta.longDescription = null;
}
nimpkg.<name>.meta.mainProgram
main executable name
type
null or string
example
{
nimpkg.<name>.meta.mainProgram = "myexec";
}
default
{
nimpkg.<name>.meta.mainProgram = null;
}
nimpkg.<name>.meta.platforms
Package Plataforms
type
null or one of "aarch64", "all", "arm", "bigEndian", "cygwin", "darwin", "embedded", "freebsd", "genode", "gnu", "i686", "illumos", "js", "linux", "littleEndian", "m68k", "mesaPlatforms", "microblaze", "mips", "mmix", "netbsd", "none", "openbsd", "or1k", "redox", "riscv", "riscv32", "riscv64", "rx", "s390", "unix", "vc4", "wasi", "windows", "x86", "x86_64"
example
{
nimpkg.<name>.meta.platforms = [
"i686-cygwin"
"x86_64-cygwin"
"x86_64-darwin"
"i686-darwin"
"aarch64-darwin"
"armv7a-darwin"
"i686-freebsd"
"x86_64-freebsd"
"aarch64-genode"
"i686-genode"
"x86_64-genode"
"x86_64-solaris"
"js-ghcjs"
"aarch64-linux"
"armv5tel-linux"
"armv6l-linux"
"armv7a-linux"
"armv7l-linux"
"i686-linux"
"m68k-linux"
"microblaze-linux"
"microblazeel-linux"
"mipsel-linux"
"mips64el-linux"
"powerpc64-linux"
"powerpc64le-linux"
"riscv32-linux"
"riscv64-linux"
"s390-linux"
"s390x-linux"
"x86_64-linux"
"mmix-mmixware"
"aarch64-netbsd"
"armv6l-netbsd"
"armv7a-netbsd"
"armv7l-netbsd"
"i686-netbsd"
"m68k-netbsd"
"mipsel-netbsd"
"powerpc-netbsd"
"riscv32-netbsd"
"riscv64-netbsd"
"x86_64-netbsd"
"aarch64_be-none"
"aarch64-none"
"arm-none"
"armv6l-none"
"avr-none"
"i686-none"
"microblaze-none"
"microblazeel-none"
"msp430-none"
"or1k-none"
"m68k-none"
"powerpc-none"
"powerpcle-none"
"riscv32-none"
"riscv64-none"
"rx-none"
"s390-none"
"s390x-none"
"vc4-none"
"x86_64-none"
"i686-openbsd"
"x86_64-openbsd"
"x86_64-redox"
"wasm64-wasi"
"wasm32-wasi"
"x86_64-windows"
"i686-windows"
];
}
default
{
nimpkg.<name>.meta.platforms = null;
}
nimpkg.<name>.nim
nim package to be used
type
null or package
example
{
nimpkg.<name>.nim = "pkgs.nim-unwrapped";
}
default
{
nimpkg.<name>.nim = null;
}
nimpkg.<name>.nimble
Configure Nimble
type
submodule
example
{
nimpkg.<name>.nimble = {
enable = false;
};
}
default
{
nimpkg.<name>.nimble = {};
}
nimpkg.<name>.nimble.enable
enable use of nimble or um nim instead
type
boolean
example
{
nimpkg.<name>.nimble.enable = false;
}
default
{
nimpkg.<name>.nimble.enable = true;
}
nimpkg.<name>.nimble.package
nimble package to be used
type
null or package
example
{
nimpkg.<name>.nimble.package = "pkgs.nimble-unwrapped";
}
default
{
nimpkg.<name>.nimble.package = null;
}
nimpkg.<name>.opts
nim compiler flags
type
submodule
example
{
nimpkg.<name>.opts = {
define = {
ssl = true;
};
threads = true;
};
}
default
{
nimpkg.<name>.opts = {};
}
nimpkg.<name>.opts.FOOTER
Insert this at end of cfg file
type
null or strings concatenated with "\n"
example
{
nimpkg.<name>.opts.FOOTER = "# IM your FOOTER";
}
default
{
nimpkg.<name>.opts.FOOTER = "";
}
nimpkg.<name>.opts.HEADER
Insert this at begin of cfg file
type
null or strings concatenated with "\n"
example
{
nimpkg.<name>.opts.HEADER = "# IM your HEADER";
}
default
{
nimpkg.<name>.opts.HEADER = "";
}
nimpkg.<name>.opts.NimblePath
add a PATH for Nimble support
type
attribute set of boolean
example
{
nimpkg.<name>.opts.NimblePath = {
X = true;
};
}
default
{
nimpkg.<name>.opts.NimblePath = {};
}
nimpkg.<name>.opts.app
generate a CONSOLE app|GUI app|DLL|STATIC library
type
null or one of "console", "gui", "lib", "staticlib"
example
{
nimpkg.<name>.opts.app = "gui";
}
default
{
nimpkg.<name>.opts.app = null;
}
nimpkg.<name>.opts.asm
produce assembler code
type
null or boolean
example
{
nimpkg.<name>.opts.asm = true;
}
default
{
nimpkg.<name>.opts.asm = null;
}
nimpkg.<name>.opts.assertions
turn assertions on|off
type
null or boolean
example
{
nimpkg.<name>.opts.assertions = true;
}
default
{
nimpkg.<name>.opts.assertions = null;
}
nimpkg.<name>.opts.backend
sets backend to use with commands like nim doc or nim r
type
null or one of "c", "cpp", "js", "objc"
example
{
nimpkg.<name>.opts.backend = "js";
}
default
{
nimpkg.<name>.opts.backend = null;
}
nimpkg.<name>.opts.benchmarkVM
turn benchmarking of VM code with cpuTime() on|off
type
null or boolean
example
{
nimpkg.<name>.opts.benchmarkVM = true;
}
default
{
nimpkg.<name>.opts.benchmarkVM = null;
}
nimpkg.<name>.opts.boundChecks
turn bound checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.boundChecks = true;
}
default
{
nimpkg.<name>.opts.boundChecks = null;
}
nimpkg.<name>.opts.cc
SYMBOL: specify the C compiler
type
null or string
example
{
nimpkg.<name>.opts.cc = "gcc";
}
default
{
nimpkg.<name>.opts.cc = null;
}
nimpkg.<name>.opts.checks
turn all runtime checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.checks = true;
}
default
{
nimpkg.<name>.opts.checks = null;
}
nimpkg.<name>.opts.cincludes
modify the C compiler header search PATH
type
attribute set of boolean
example
{
nimpkg.<name>.opts.cincludes = {
X = true;
};
}
default
{
nimpkg.<name>.opts.cincludes = {};
}
nimpkg.<name>.opts.clearNimblePath
empty the list of Nimble package search paths
type
null or boolean
example
{
nimpkg.<name>.opts.clearNimblePath = true;
}
default
{
nimpkg.<name>.opts.clearNimblePath = null;
}
nimpkg.<name>.opts.clib
link an additional C LIBRARY (you should omit platform-specific extensions)
type
attribute set of boolean
example
{
nimpkg.<name>.opts.clib = {
X = true;
};
}
default
{
nimpkg.<name>.opts.clib = {};
}
nimpkg.<name>.opts.clibdir
modify the linker library search PATH
type
attribute set of boolean
example
{
nimpkg.<name>.opts.clibdir = {
X = true;
};
}
default
{
nimpkg.<name>.opts.clibdir = {};
}
nimpkg.<name>.opts.colors
turn compiler messages coloring on|off
type
null or boolean
example
{
nimpkg.<name>.opts.colors = true;
}
default
{
nimpkg.<name>.opts.colors = null;
}
nimpkg.<name>.opts.compileOnly
compile Nim files only; do not assemble or link
type
null or boolean
example
{
nimpkg.<name>.opts.compileOnly = true;
}
default
{
nimpkg.<name>.opts.compileOnly = null;
}
nimpkg.<name>.opts.cppCompileToNamespace
use the provided NAMESPACE for the generated C++ code, if no namespace is provided "Nim" will be used
type
attribute set of boolean
example
{
nimpkg.<name>.opts.cppCompileToNamespace = {
X = true;
};
}
default
{
nimpkg.<name>.opts.cppCompileToNamespace = {};
}
nimpkg.<name>.opts.cpu
SYMBOL: set the target processor (cross-compilation)
type
null or string
example
{
nimpkg.<name>.opts.cpu = "x86-64";
}
default
{
nimpkg.<name>.opts.cpu = null;
}
nimpkg.<name>.opts.debugger
use native debugger (gdb)
type
null or value "native" (singular enum)
example
{
nimpkg.<name>.opts.debugger = "native";
}
default
{
nimpkg.<name>.opts.debugger = null;
}
nimpkg.<name>.opts.debuginfo
enables debug information
type
null or boolean
example
{
nimpkg.<name>.opts.debuginfo = true;
}
default
{
nimpkg.<name>.opts.debuginfo = null;
}
nimpkg.<name>.opts.declaredLocs
show declaration locations in messages
type
null or boolean
example
{
nimpkg.<name>.opts.declaredLocs = true;
}
default
{
nimpkg.<name>.opts.declaredLocs = null;
}
nimpkg.<name>.opts.deepcopy
enable 'system.deepCopy' for --mm:arc|orc
type
null or boolean
example
{
nimpkg.<name>.opts.deepcopy = true;
}
default
{
nimpkg.<name>.opts.deepcopy = null;
}
nimpkg.<name>.opts.define
Define a conditional symbol
Optionally: Define the value for that symbol, see compile time define pragmas.
Unlike other symbols that follow identifier equality of nim, define sysymbols are full case insensitive.
Example:
All defined will match with -d:A_B
when defined aB:
echo "aB"
when defined Ab:
echo "Ab"
when defined a_b:
echo "a_b"
Some define
options
This is a list of some define options found in Nim/Nim stdlib source code.
Look at your dependency documentation to check if they define theirs own or require some of them.
And some of them should be compiler paramaters.
ie:
-d:consoleapp
should be--app:console
-d:linux
should be--os:linux
Most common:
- release (for a release build)
- ssl (activate SSL sockets/HTTPS)
- mingw (cross compile for windows)
Hardware:
- avr
- amd64
- arm
- arm64
- atari
- cpu16
- cpu32
- cpu64
- e2k
- hppa
- hp9000
- hp9000s300
- hp9000s700
- hp9000s800
- hp9000s820
- i386
- ia64
- loongarch64
- m68k
- mips
- mips64
- mips64el
- mipsel
- msp430
- nintendoswitch
- parisc
- powerpc
- powerpc64
- powerpc64el
- riscv32
- riscv64
- sparc
- sparc64
- sparcv9
- x86
- wasm
- wasm32
Arch Related
- nimPinToCpu
OS:
- aix
- amiga
- alpha
- android
- android4
- bsd
- dmc
- dos
- dragonfly
- freebsd
- freertos
- genode
- haiku
- hpux
- ios
- irix
- linux
- macos
- macosx
- morphos
- netbsd
- netware
- openbsd
- os2
- osx
- palmos
- posix
- qnx
- riscos
- standalone
- skyos
- solaris
- sunos
- unix
- windows
- zephyr
- vxworks
OS Related
- kqcache (BSD)
- SocketMaxConnections = 32 (freertos)
Compillers:
- bcc
- clang
- clangcl
- gcc
- icc
- icl
- llvm_gcc
- tcc
- vcc
- wcc
Languages
- c
- cpp
- js
- nimscript
Lang Related
- booting
- consoleapp
- guiapp
- kwin
- nimJsMathTruncPolyfill
- nimJsonGet
- nimLegacyJsRound
- nimble
- nimconfig
- nimdoc
- nimsuggest
- noCppExceptions
- nodejs
- vm
Lib C
- emscripten
- nimNoLibc
- uClibc
Lib Related
- lwip
- lwip6
- nimNetLite
- ODBCVER
- staticSqlite
- usePcreHeader
- nimExperimentalLinenoiseExtra
SSL
- ssl
- libressl
SSL Related
- openssl10
- sslVersion = ""
- useOpenssl3 = sslVersion.startsWith('3')
- noOpenSSLHacks
- nimDisableCertificateValidation
- nimTlsSize = 16000
Memory Management
- boehmgc
- boehmNoIntPtr
- gcArc
- gcOrc
- gogc
- nogc
MM Related
- builtinOverflow
- gcDestructors
- gcHooks
- gcMarkAndSweep
- gcRegions
- gcUseBitvectors
- ignoreAllocationSize
- logGC
- memProfiler
- memtracker (memTracker)
- nimAlignPragma
- nimAllocNoUnmap
- nimAllocPagesViaMalloc
- nimAllocStats
- nimArcDebug
- nimArcIds
- nimEmulateOverflowChecks
- nimFixedOrc
- nimFixedOwned
- nimHasLentIterators
- nimHasSinkInference
- nimLeakDetector
- nimMaxHeap = 0
- nimMemAlignTiny
- nimMinHeapPages = 128
- nimMinHeapPages = 4
- nimNoAllocForSSL
- nimNoLentIterators
- nimOwnedEnabled
- nimPage1k
- nimPage256
- nimPage512
- nimStressOrc
- sizeofInt128
- StandaloneHeapSize = 1024 * PageSize
- traceArc
- useGcAssert
- useMalloc
- useRealtimeGC
- zephyrUseLibcMalloc
Threads
- threadsafe
- MaxDistinguishedThread = 32
- MaxThreadPoolSize = 256
- nimThreadStackGuard = 128
- nimThreadStackSize = 8192
- threadpoolWaitMs = 100
Debug
- androidNDK
- debugFmtDsl
- debugHeapLinks
- debugScanp
- futureLogging
- hotcodereloading
- hotCodeReloading
- nativeStacktrace
- nativeStackTrace
- nimAuditDelete
- nimDebugDlOpen
- nimDoesntTrackDefects
- nimDumpAsync
- nimFulldebug
- nimQuirky
- nimTracing
- nimTrMacros
- nimStackTraceOverride
- nimTasksDebug
- profiler
- testing
- testNimHcr
- traceHcr
Others
- avlcorruption and nimAvlcorruption
- createNimHcr
- createNimRtl
- nimCallDepthLimit = 2000
- globalSymbols
- net_ipv4
- net_ipv6
- net_raw
- nimBuiltinSetjmp
- nimCoroutines
- nimCoroutinesSetjmp
- nimCoroutinesSetjmpBundled
- nimCoroutinesUcontext
- nimCorruption
- nimCycleBreaker
- nimDontSetUtf8CodePage
- nimFixedForwardGeneric
- nimHasCallsitePragma
- nimHasCursor
- nimHasDeclaredMagic
- nimHasEffectsOf
- nimHasEnforceNoRaises
- nimHasExceptionsQuery
- nimHasInvariant
- nimHasIsNamedTuple
- nimHasIterable
- nimHasOutParams
- nimHasStacktraceMsgs
- nimHasStyleChecks
- nimHasTemplateRedefinitionPragma
- nimHasTopDownInference
- nimHasTrace
- nimHasUsed
- nimHasWorkaround14720
- nimHashOrdinalFixed
- nimIcIntegrityChecks
- nimImportutilsExample
- nimInheritHandles
- nimIntHash1
- nimLagacyOptionsDollar
- nimLegacyCopyFile
- nimLegacyMacrosCollapseSymChoice
- nimLegacyParseQueryStrict
- nimLegacyRandomInitRand
- nimLegacySigpipeHandler
- nimMacrosGetNodeId
- nimMaxDescriptorsFallback = 16000 (asynchttpserver)
- nimNewIntegerOps
- nimNewShared
- nimNoArrayToString
- nimNoGetRandom
- nimNoQuit
- nimNoZeroExtendMagic
- nimOldCaseObjects
- nimOldDlls
- nimOldEcho
- nimOldRelativePathBehavior
- nimOldShiftRight
- nimOptimizedSplitChunk
- nimPanics
- nimPollHasEventFds
- nimPreviewFloatRoundtrip
- nimPreviewHashRef
- nimPreviewJsonutilsHoleyEnum
- nimPreviewSlimSystem
- nimRawSetjmp
- nimRecursiveSpawn
- nimSeqsV2
- nimShallowStrings
- nimSigSetjmp
- nimSmokeCycles
- nimStdSetjmp
- nimStrictDelete
- nimSymImplTransform
- nimTempPathLength = 8
- nimThinout
- nimToOpenArrayCString
- nimTypeNames
- nimUnittestAbortOnError
- nimUnittestOutputLevel = "..."
- nimUnittestColor = "auto" (auto|on|off)
- nimUse64BitCTime
- nimV2
- nimfix
- noIntrinsicsBitOpts
- noNimCoroutines
- noSignalHandler
- noUndefinedBitOpts
- noUnidecodeTable
- posixRealtime
- reportMissedDeadlines
- tempDir = "..."
- useClone
- useFork
- useNimRtl
- useShPath = "..."
- useStdoutAsStdmsg
- useSysAssert
- useWinAnsi
type
attribute set of (boolean or signed integer or string)
example
{
nimpkg.<name>.opts.define = {
X = "some value";
Y = true;
Z = 42;
logGC = true;
ssl = true;
};
}
default
{
nimpkg.<name>.opts.define = {};
}
nimpkg.<name>.opts.defusages
find the definition and all usages of a symbol
type
attribute set of boolean
example
{
nimpkg.<name>.opts.defusages = {
X = true;
};
}
default
{
nimpkg.<name>.opts.defusages = {};
}
nimpkg.<name>.opts.docCmd
CMD: if cmd eq skip, skips runnableExamples else, runs runnableExamples with given options
type
null or string
example
{
nimpkg.<name>.opts.docCmd = "-d:foo --threads:on";
}
default
{
nimpkg.<name>.opts.docCmd = null;
}
nimpkg.<name>.opts.docInternal
also generate documentation for non-exported symbols
type
null or boolean
example
{
nimpkg.<name>.opts.docInternal = true;
}
default
{
nimpkg.<name>.opts.docInternal = null;
}
nimpkg.<name>.opts.docRoot
PATH: nim doc --docRoot:/foo --project --outdir:docs /foo/sub/main.nim generates: docs/sub/main.html if path eq @pkg, will use nimble file enclosing dir if path eq @path, will use first matching dir in --path if path eq @default (the default and most useful), will use best match among @pkg,@path. if these are nonexistent, will use project path
type
null or string
example
{
nimpkg.<name>.opts.docRoot = "/foot";
}
default
{
nimpkg.<name>.opts.docRoot = null;
}
nimpkg.<name>.opts.docSeeSrcUrl
URL: activate 'see source' for doc command (see doc.item.seesrc in config/nimdoc.cfg)
type
null or string
example
{
nimpkg.<name>.opts.docSeeSrcUrl = "https://github.com/riinr/nim-flake-lib/";
}
default
{
nimpkg.<name>.opts.docSeeSrcUrl = null;
}
nimpkg.<name>.opts.dynlibOverride
marks SYMBOL so that dynlib:SYMBOL has no effect and can be statically linked instead; symbol matching is fuzzy so that --dynlibOverride:lua matches dynlib: "liblua.so.3"
type
attribute set of boolean
example
{
nimpkg.<name>.opts.dynlibOverride = {
X = true;
};
}
default
{
nimpkg.<name>.opts.dynlibOverride = {};
}
nimpkg.<name>.opts.dynlibOverrideAll
disables the effects of the dynlib pragma
type
null or boolean
example
{
nimpkg.<name>.opts.dynlibOverrideAll = true;
}
default
{
nimpkg.<name>.opts.dynlibOverrideAll = null;
}
nimpkg.<name>.opts.embedsrc
embeds the original source code as comments in the generated output
type
null or boolean
example
{
nimpkg.<name>.opts.embedsrc = true;
}
default
{
nimpkg.<name>.opts.embedsrc = null;
}
nimpkg.<name>.opts.errorMax
stop compilation after N errors; 0 means unlimited
type
null or unsigned integer, meaning >=0
example
{
nimpkg.<name>.opts.errorMax = 4;
}
default
{
nimpkg.<name>.opts.errorMax = null;
}
nimpkg.<name>.opts.exceptions
select the exception handling implementation
type
null or one of "setjmp", "cpp", "goto", "quirky"
example
{
nimpkg.<name>.opts.exceptions = "setjmp";
}
default
{
nimpkg.<name>.opts.exceptions = null;
}
nimpkg.<name>.opts.excessiveStackTrace
stack traces use full file paths
type
null or boolean
example
{
nimpkg.<name>.opts.excessiveStackTrace = true;
}
default
{
nimpkg.<name>.opts.excessiveStackTrace = null;
}
nimpkg.<name>.opts.excludePath
exclude a PATH from the list of search paths
type
attribute set of boolean
example
{
nimpkg.<name>.opts.excludePath = {
X = true;
};
}
default
{
nimpkg.<name>.opts.excludePath = {};
}
nimpkg.<name>.opts.expandArc
show how PROCNAME looks like after diverse optimizations before the final backend phase (mostly ARC/ORC specific)
type
attribute set of boolean
example
{
nimpkg.<name>.opts.expandArc = {
X = true;
};
}
default
{
nimpkg.<name>.opts.expandArc = {};
}
nimpkg.<name>.opts.expandMacro
dump every generated AST from MACRO
type
attribute set of boolean
example
{
nimpkg.<name>.opts.expandMacro = {
X = true;
};
}
default
{
nimpkg.<name>.opts.expandMacro = {};
}
nimpkg.<name>.opts.experimental
enable experimental language FEATURE
type
attribute set of boolean
example
{
nimpkg.<name>.opts.experimental = {
X = true;
};
}
default
{
nimpkg.<name>.opts.experimental = {};
}
nimpkg.<name>.opts.fieldChecks
turn case variant field checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.fieldChecks = true;
}
default
{
nimpkg.<name>.opts.fieldChecks = null;
}
nimpkg.<name>.opts.filenames
customize how filenames are rendered in compiler messages, defaults to abs (absolute)
type
null or one of "abs", "canonical", "legacyRelProj"
example
{
nimpkg.<name>.opts.filenames = "abs";
}
default
{
nimpkg.<name>.opts.filenames = null;
}
nimpkg.<name>.opts.floatChecks
turn all floating point (NaN/Inf) checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.floatChecks = true;
}
default
{
nimpkg.<name>.opts.floatChecks = null;
}
nimpkg.<name>.opts.forceBuild
force rebuilding of all modules
type
null or boolean
example
{
nimpkg.<name>.opts.forceBuild = true;
}
default
{
nimpkg.<name>.opts.forceBuild = null;
}
nimpkg.<name>.opts.genScript
generate a compile script (in the 'nimcache' subdirectory named 'compile_$$project$$scriptext'), and a '.deps' file containing the dependencies; implies --compileOnly
type
null or boolean
example
{
nimpkg.<name>.opts.genScript = true;
}
default
{
nimpkg.<name>.opts.genScript = null;
}
nimpkg.<name>.opts.hint
turn specific HINT X on|off. hint:X means hint:X:on, as with similar flags. all is the set of all hints (only all:off is supported).
type
attribute set of boolean
example
{
nimpkg.<name>.opts.hint = {
X = true;
};
}
default
{
nimpkg.<name>.opts.hint = {};
}
nimpkg.<name>.opts.hintAsError
turn specific HINT X into an error on|off
type
attribute set of boolean
example
{
nimpkg.<name>.opts.hintAsError = {
X = true;
};
}
default
{
nimpkg.<name>.opts.hintAsError = {};
}
nimpkg.<name>.opts.hints
on|off enables or disables hints. list reports which hints are selected.
type
null or boolean
example
{
nimpkg.<name>.opts.hints = true;
}
default
{
nimpkg.<name>.opts.hints = null;
}
nimpkg.<name>.opts.hotCodeReloading
turn support for hot code reloading on|off
type
null or boolean
example
{
nimpkg.<name>.opts.hotCodeReloading = true;
}
default
{
nimpkg.<name>.opts.hotCodeReloading = null;
}
nimpkg.<name>.opts.implicitStatic
turn implicit compile time evaluation on|off
type
null or boolean
example
{
nimpkg.<name>.opts.implicitStatic = true;
}
default
{
nimpkg.<name>.opts.implicitStatic = null;
}
nimpkg.<name>.opts.import
add an automatically imported MODULE see also patchFile in nimscript which offers more flexibility.
type
attribute set of boolean
example
{
nimpkg.<name>.opts.import = {
X = true;
};
}
default
{
nimpkg.<name>.opts.import = {};
}
nimpkg.<name>.opts.include
add an automatically included MODULE
type
attribute set of boolean
example
{
nimpkg.<name>.opts.include = {
X = true;
};
}
default
{
nimpkg.<name>.opts.include = {};
}
nimpkg.<name>.opts.incremental
only recompile the changed modules (experimental!)
type
null or boolean
example
{
nimpkg.<name>.opts.incremental = true;
}
default
{
nimpkg.<name>.opts.incremental = null;
}
nimpkg.<name>.opts.index
turn index file generation on|off
type
null or boolean
example
{
nimpkg.<name>.opts.index = true;
}
default
{
nimpkg.<name>.opts.index = null;
}
nimpkg.<name>.opts.infChecks
turn Inf checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.infChecks = true;
}
default
{
nimpkg.<name>.opts.infChecks = null;
}
nimpkg.<name>.opts.legacy
enable obsolete/legacy language FEATURE
type
attribute set of boolean
example
{
nimpkg.<name>.opts.legacy = {
X = true;
};
}
default
{
nimpkg.<name>.opts.legacy = {};
}
nimpkg.<name>.opts.lib
PATH: set the system library path
type
null or string
example
{
nimpkg.<name>.opts.lib = "./my_nim";
}
default
{
nimpkg.<name>.opts.lib = null;
}
nimpkg.<name>.opts.lineDir
generation of #line directive on|off
type
null or boolean
example
{
nimpkg.<name>.opts.lineDir = true;
}
default
{
nimpkg.<name>.opts.lineDir = null;
}
nimpkg.<name>.opts.lineTrace
turn line tracing on|off
type
null or boolean
example
{
nimpkg.<name>.opts.lineTrace = true;
}
default
{
nimpkg.<name>.opts.lineTrace = null;
}
nimpkg.<name>.opts.listCmd
list the compilation commands; can be combined with --hint:exec:on and --hint:link:on
type
null or boolean
example
{
nimpkg.<name>.opts.listCmd = true;
}
default
{
nimpkg.<name>.opts.listCmd = null;
}
nimpkg.<name>.opts.maxLoopIterationsVM
set max iterations for all VM loops
type
null or positive integer, meaning >0
example
{
nimpkg.<name>.opts.maxLoopIterationsVM = 10000;
}
default
{
nimpkg.<name>.opts.maxLoopIterationsVM = null;
}
nimpkg.<name>.opts.mm
select which memory management to use; default is 'refc' recommended is 'orc'
type
null or one of "orc", "arc", "refc", "markAndSweep", "boehm", "go", "none", "regions"
example
{
nimpkg.<name>.opts.mm = "orc";
}
default
{
nimpkg.<name>.opts.mm = null;
}
nimpkg.<name>.opts.multimethods
turn multi-methods on|off
type
null or boolean
example
{
nimpkg.<name>.opts.multimethods = true;
}
default
{
nimpkg.<name>.opts.multimethods = null;
}
nimpkg.<name>.opts.nanChecks
turn NaN checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.nanChecks = true;
}
default
{
nimpkg.<name>.opts.nanChecks = null;
}
nimpkg.<name>.opts.nimMainPrefix
PREFIX: use {prefix}NimMain instead of NimMain in the produced C/C++ code
type
null or string
example
{
nimpkg.<name>.opts.nimMainPrefix = "nim_c_";
}
default
{
nimpkg.<name>.opts.nimMainPrefix = null;
}
nimpkg.<name>.opts.nimcache
PATH: set the path used for generated files see also
type
null or string
example
{
nimpkg.<name>.opts.nimcache = "./cache";
}
default
{
nimpkg.<name>.opts.nimcache = null;
}
nimpkg.<name>.opts.noLinking
compile Nim and generated files but do not link
type
null or boolean
example
{
nimpkg.<name>.opts.noLinking = true;
}
default
{
nimpkg.<name>.opts.noLinking = null;
}
nimpkg.<name>.opts.noMain
do not generate a main procedure
type
null or boolean
example
{
nimpkg.<name>.opts.noMain = true;
}
default
{
nimpkg.<name>.opts.noMain = null;
}
nimpkg.<name>.opts.noNimblePath
deactivate the Nimble path
type
null or boolean
example
{
nimpkg.<name>.opts.noNimblePath = true;
}
default
{
nimpkg.<name>.opts.noNimblePath = null;
}
nimpkg.<name>.opts.objChecks
turn obj conversion checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.objChecks = true;
}
default
{
nimpkg.<name>.opts.objChecks = null;
}
nimpkg.<name>.opts.opt
optimize not at all or for speed|size Note: use -d:release for a release build!
type
null or one of "none", "speed", "size"
example
{
nimpkg.<name>.opts.opt = "speed";
}
default
{
nimpkg.<name>.opts.opt = null;
}
nimpkg.<name>.opts.os
SYMBOL: set the target operating system (cross-compilation)
type
null or string
example
{
nimpkg.<name>.opts.os = "linux";
}
default
{
nimpkg.<name>.opts.os = null;
}
nimpkg.<name>.opts.out
FILE: set the output filename
type
null or string
example
{
nimpkg.<name>.opts.out = "my_bin";
}
default
{
nimpkg.<name>.opts.out = null;
}
nimpkg.<name>.opts.outdir
DIR: set the path where the output file will be written
type
null or string
example
{
nimpkg.<name>.opts.outdir = "./bin";
}
default
{
nimpkg.<name>.opts.outdir = null;
}
nimpkg.<name>.opts.overflowChecks
turn int over-/underflow checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.overflowChecks = true;
}
default
{
nimpkg.<name>.opts.overflowChecks = null;
}
nimpkg.<name>.opts.panics
turn panics into process terminations (default: off)
type
null or boolean
example
{
nimpkg.<name>.opts.panics = true;
}
default
{
nimpkg.<name>.opts.panics = null;
}
nimpkg.<name>.opts.parallelBuild
perform a parallel build value = number of processors (0 for auto-detect)
type
null or unsigned integer, meaning >=0
example
{
nimpkg.<name>.opts.parallelBuild = 4;
}
default
{
nimpkg.<name>.opts.parallelBuild = null;
}
nimpkg.<name>.opts.passC
OPTION: pass an option to the C compiler
type
null or strings concatenated with "\n"
example
{
nimpkg.<name>.opts.passC = "-flto";
}
default
{
nimpkg.<name>.opts.passC = null;
}
nimpkg.<name>.opts.passL
OPTION: pass an option to the linker
type
null or strings concatenated with "\n"
example
{
nimpkg.<name>.opts.passL = "-flto";
}
default
{
nimpkg.<name>.opts.passL = null;
}
nimpkg.<name>.opts.path
add PATH to search paths
type
attribute set of boolean
example
{
nimpkg.<name>.opts.path = {
X = true;
};
}
default
{
nimpkg.<name>.opts.path = {};
}
nimpkg.<name>.opts.processing
show files as they're being processed by nim compiler
type
null or one of "dots", "filenames", "off"
example
{
nimpkg.<name>.opts.processing = "filenames";
}
default
{
nimpkg.<name>.opts.processing = null;
}
nimpkg.<name>.opts.profileVM
turn compile time VM profiler on|off
type
null or boolean
example
{
nimpkg.<name>.opts.profileVM = true;
}
default
{
nimpkg.<name>.opts.profileVM = null;
}
nimpkg.<name>.opts.project
document the whole project (doc)
type
null or boolean
example
{
nimpkg.<name>.opts.project = true;
}
default
{
nimpkg.<name>.opts.project = null;
}
nimpkg.<name>.opts.putenv
set an environment variable
type
attribute set of string
example
{
nimpkg.<name>.opts.putenv = {
LANG = "en_US.UTF-8";
X = "some value";
};
}
default
{
nimpkg.<name>.opts.putenv = {};
}
nimpkg.<name>.opts.rangeChecks
turn range checks on|off
type
null or boolean
example
{
nimpkg.<name>.opts.rangeChecks = true;
}
default
{
nimpkg.<name>.opts.rangeChecks = null;
}
nimpkg.<name>.opts.showAllMismatches
show all mismatching candidates in overloading resolution
type
null or boolean
example
{
nimpkg.<name>.opts.showAllMismatches = true;
}
default
{
nimpkg.<name>.opts.showAllMismatches = null;
}
nimpkg.<name>.opts.sinkInference
turn sink parameter inference on|off (default: on)
type
null or boolean
example
{
nimpkg.<name>.opts.sinkInference = true;
}
default
{
nimpkg.<name>.opts.sinkInference = null;
}
nimpkg.<name>.opts.skipCfg
do not read the nim installation's configuration file
type
null or boolean
example
{
nimpkg.<name>.opts.skipCfg = true;
}
default
{
nimpkg.<name>.opts.skipCfg = null;
}
nimpkg.<name>.opts.skipParentCfg
do not read the parent dirs' configuration files
type
null or boolean
example
{
nimpkg.<name>.opts.skipParentCfg = true;
}
default
{
nimpkg.<name>.opts.skipParentCfg = null;
}
nimpkg.<name>.opts.skipProjCfg
do not read the project's configuration file
type
null or boolean
example
{
nimpkg.<name>.opts.skipProjCfg = true;
}
default
{
nimpkg.<name>.opts.skipProjCfg = null;
}
nimpkg.<name>.opts.skipUserCfg
do not read the user's configuration file
type
null or boolean
example
{
nimpkg.<name>.opts.skipUserCfg = true;
}
default
{
nimpkg.<name>.opts.skipUserCfg = null;
}
nimpkg.<name>.opts.spellSuggest
show at most num >= 0 spelling suggestions on typos. if num is not specified (or auto), return an implementation defined set of suggestions.
type
null or positive integer, meaning >0
example
{
nimpkg.<name>.opts.spellSuggest = 10;
}
default
{
nimpkg.<name>.opts.spellSuggest = null;
}
nimpkg.<name>.opts.stackTrace
turn stack tracing on|off
type
null or boolean
example
{
nimpkg.<name>.opts.stackTrace = true;
}
default
{
nimpkg.<name>.opts.stackTrace = null;
}
nimpkg.<name>.opts.stackTraceMsgs
enable user defined stack frame msgs via setFrameMsg
type
null or boolean
example
{
nimpkg.<name>.opts.stackTraceMsgs = true;
}
default
{
nimpkg.<name>.opts.stackTraceMsgs = null;
}
nimpkg.<name>.opts.stdout
output to stdout
type
null or boolean
example
{
nimpkg.<name>.opts.stdout = true;
}
default
{
nimpkg.<name>.opts.stdout = null;
}
nimpkg.<name>.opts.styleCheck
produce hints or errors for Nim identifiers that do not adhere to Nim's official style guide. styleCheck:usages - only enforce consistent spellings of identifiers, do not enforce the style on declarations
type
null or one of "off", "hint", "error", "usages"
example
{
nimpkg.<name>.opts.styleCheck = "hint";
}
default
{
nimpkg.<name>.opts.styleCheck = null;
}
nimpkg.<name>.opts.threads
turn support for multi-threading on|off
type
null or boolean
example
{
nimpkg.<name>.opts.threads = true;
}
default
{
nimpkg.<name>.opts.threads = null;
}
nimpkg.<name>.opts.tlsEmulation
turn thread local storage emulation on|off
type
null or boolean
example
{
nimpkg.<name>.opts.tlsEmulation = true;
}
default
{
nimpkg.<name>.opts.tlsEmulation = null;
}
nimpkg.<name>.opts.trmacros
turn term rewriting macros on|off
type
null or boolean
example
{
nimpkg.<name>.opts.trmacros = true;
}
default
{
nimpkg.<name>.opts.trmacros = null;
}
nimpkg.<name>.opts.undef
undefine a conditional SYMBOL
type
attribute set of boolean
example
{
nimpkg.<name>.opts.undef = {
X = true;
};
}
default
{
nimpkg.<name>.opts.undef = {};
}
nimpkg.<name>.opts.unitsep
use the ASCII unit separator (31) between error messages, useful for IDE-like tooling
type
null or boolean
example
{
nimpkg.<name>.opts.unitsep = true;
}
default
{
nimpkg.<name>.opts.unitsep = null;
}
nimpkg.<name>.opts.useVersion
emulate Nim version X of the Nim compiler, for testing
type
null or one of "1.0", "1.2"
example
{
nimpkg.<name>.opts.useVersion = "1.2";
}
default
{
nimpkg.<name>.opts.useVersion = null;
}
nimpkg.<name>.opts.usenimcache
will use $$nimcache, whichever it resolves to after all options have been processed
type
null or boolean
example
{
nimpkg.<name>.opts.usenimcache = true;
}
default
{
nimpkg.<name>.opts.usenimcache = null;
}
nimpkg.<name>.opts.verbosity
set Nim's verbosity level (1 is default)
type
null or one of 0, 1, 2, 3
example
{
nimpkg.<name>.opts.verbosity = 3;
}
default
{
nimpkg.<name>.opts.verbosity = null;
}
nimpkg.<name>.opts.warning
turn on|off WARNING
type
attribute set of boolean
example
{
nimpkg.<name>.opts.warning = {
X = true;
};
}
default
{
nimpkg.<name>.opts.warning = {};
}
nimpkg.<name>.opts.warningAsError
turn some WARNING in ERROR
type
attribute set of boolean
example
{
nimpkg.<name>.opts.warningAsError = {
X = true;
};
}
default
{
nimpkg.<name>.opts.warningAsError = {};
}
nimpkg.<name>.opts.warnings
same as --hints but for warnings.
type
null or boolean
example
{
nimpkg.<name>.opts.warnings = true;
}
default
{
nimpkg.<name>.opts.warnings = null;
}
nimpkg.<name>.patch-elf
patch elf after build using (https://github.com/NixOS/patchelf)
type
attribute set of (submodule)
example
{
nimpkg.<name>.patch-elf = {};
}
default
{
nimpkg.<name>.patch-elf = {};
}
nimpkg.<name>.patch-elf.<name>.enable
patch elf change dynamic library loader
type
boolean
example
{
nimpkg.<name>.patch-elf.<name>.enable = true;
}
default
{
nimpkg.<name>.patch-elf.<name>.enable = true;
}
nimpkg.<name>.patch-elf.<name>.package
nim package to be used
type
null or package
example
{
nimpkg.<name>.patch-elf.<name>.package = "pkgs.nim-unwrapped";
}
default
{
nimpkg.<name>.patch-elf.<name>.package = null;
}
nimpkg.<name>.patch-elf.<name>.add-need
add needed LIBRARY
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.add-need = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.add-need = null;
}
nimpkg.<name>.patch-elf.<name>.add-rpath
add 'RPATH'
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.add-rpath = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.add-rpath = null;
}
nimpkg.<name>.patch-elf.<name>.allowed-rpath-prefix
allowed-rpath-prefix
type
null or strings concatenated with "\n"
example
{
nimpkg.<name>.patch-elf.<name>.allowed-rpath-prefix = "a b c";
}
default
{
nimpkg.<name>.patch-elf.<name>.allowed-rpath-prefix = null;
}
nimpkg.<name>.patch-elf.<name>.clear-symbol-version
celar SYMBOL version
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.clear-symbol-version = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.clear-symbol-version = null;
}
nimpkg.<name>.patch-elf.<name>.file
celar SYMBOL version
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.file = "myexectuable";
}
nimpkg.<name>.patch-elf.<name>.interpreter
add --set-interpreter INTERPRETER
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.interpreter = "/lib64/ld-linux-x86-64.so.2";
}
default
{
nimpkg.<name>.patch-elf.<name>.interpreter = null;
}
nimpkg.<name>.patch-elf.<name>.no-default-lib
shrink rpath
type
boolean
example
{
nimpkg.<name>.patch-elf.<name>.no-default-lib = true;
}
default
{
nimpkg.<name>.patch-elf.<name>.no-default-lib = false;
}
nimpkg.<name>.patch-elf.<name>.output
celar SYMBOL version
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.output = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.output = null;
}
nimpkg.<name>.patch-elf.<name>.page-size
add --page-size SIZE
type
null or unsigned integer, meaning >=0
example
{
nimpkg.<name>.patch-elf.<name>.page-size = 64;
}
default
{
nimpkg.<name>.patch-elf.<name>.page-size = null;
}
nimpkg.<name>.patch-elf.<name>.remove-need
remove needed LIBRARY
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.remove-need = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.remove-need = null;
}
nimpkg.<name>.patch-elf.<name>.remove-rpath
remove rpath
type
boolean
example
{
nimpkg.<name>.patch-elf.<name>.remove-rpath = true;
}
default
{
nimpkg.<name>.patch-elf.<name>.remove-rpath = false;
}
nimpkg.<name>.patch-elf.<name>.replace-need
replace needed LIBRARY
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.replace-need = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.replace-need = null;
}
nimpkg.<name>.patch-elf.<name>.set-rpath
Sets 'RPATH' to RPATH
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.set-rpath = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.set-rpath = null;
}
nimpkg.<name>.patch-elf.<name>.set-soname
Sets 'DT_SONAME' entry to SONAME
type
null or string
example
{
nimpkg.<name>.patch-elf.<name>.set-soname = "";
}
default
{
nimpkg.<name>.patch-elf.<name>.set-soname = null;
}
nimpkg.<name>.patch-elf.<name>.shrink-rpath
shrink rpath
type
boolean
example
{
nimpkg.<name>.patch-elf.<name>.shrink-rpath = true;
}
default
{
nimpkg.<name>.patch-elf.<name>.shrink-rpath = false;
}
nimpkg.<name>.runDeps
Runtime dependencies like libraries or executables
type
list of package
example
{
nimpkg.<name>.runDeps = [
"openssl"
"jq"
"nodejs"
];
}
default
{
nimpkg.<name>.runDeps = [];
}
nimpkg.<name>.src
src to be compiled
type
null or path
example
{
nimpkg.<name>.src = "./.";
}
default
{
nimpkg.<name>.src = null;
}
nimpkg.<name>.strip
strip executable
type
boolean
example
{
nimpkg.<name>.strip = false;
}
default
{
nimpkg.<name>.strip = true;
}
nimpkg.<name>.version
package version
type
null or string
example
{
nimpkg.<name>.version = "0.1.0";
}
default
{
nimpkg.<name>.version = null;
}
See also
- Read The Fine Manual riinr.github.io/nim-flakes-lib/
- Flake Nimble, auto generated flakes from packages.json
- Flake Crown, hard fork of Flake Nimble to use flake for pinning using this lib.
- Cosmonim, compile Nim with Cosmopolitan libc.
- Hello Musl, compile Nim with Musl + PCRE + libressl.
- Nim Emscripten Tutorial, compile Nim for WASM.