You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nimble-guide/docs/index.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,40 @@ Nimble packages are typically hosted in Git repositories so you may be able to g
31
31
32
32
33
33
34
+
## Automatic Nim Version Management
35
+
36
+
Nimble can automatically download and manage Nim versions for your projects. This feature ensures that each project uses the correct Nim version without manual intervention.
37
+
38
+
### How It Works
39
+
40
+
When you run Nimble commands like `build` or `install`:
41
+
42
+
1.**Nimble checks your project's Nim requirement** specified in the `.nimble` file (e.g., `requires "nim >= 2.0.0"`)
43
+
2.**If a compatible Nim is not available**, Nimble automatically downloads a prebuilt binary from [nim-lang.org](https://nim-lang.org)
44
+
3.**The downloaded Nim is cached** in `~/.nimble/nim/` and reused for future builds
45
+
46
+
### Benefits
47
+
48
+
-**No manual Nim installation required** - Just install Nimble and start building
49
+
-**Per-project Nim versions** - Different projects can use different Nim versions
50
+
-**Lock file support** - The exact Nim version can be pinned in `nimble.lock`
51
+
-**Automatic updates** - When a project requires a newer Nim, it's downloaded automatically
52
+
53
+
### Using System Nim
54
+
55
+
Nimble will always try to match your system Nim version against the project's requirements. The `--useSystemNim` flag is used to bypass stricter constraints when you want to force the use of your locally installed Nim:
56
+
57
+
```sh
58
+
nimble build --useSystemNim
59
+
```
60
+
61
+
This is useful when:
62
+
63
+
- You have a custom Nim build
64
+
- You're working offline and already have Nim installed
65
+
- You want to test with a specific Nim version not available as a binary
66
+
67
+
34
68
## Getting Started
35
69
36
70
- If you wish to explore existing Nim packages and install some of them, follow the [using packages guide](./use-packages.md).
0 commit comments