Nim choosenim¶
- ID
choosenim- Home page
- Version requirement
>= 0.8.4
- Platforms
🐧 Linux · 🍎 macOS · 🪟 Windows
- Operations
installed·search·install·upgrade·remove- purl types
pkg:choosenim- CLI name
choosenim- Every call
choosenim <command> --noColor- Forced environment
CHOOSENIM_NO_ANALYTICS=1- Issues and PRs
- Source
choosenim is the Nim toolchain installer (https://github.com/nim-lang/choosenim).
The project moved from dom96/choosenim to the nim-lang organisation, and
the old repository is neither archived nor deprecated: it still outranks the
live one in search results, which is what
dom96/choosenim#349 was opened
to fix. The old repository stopped at 0.8.4 in July 2022; nim-lang carries
the whole release history, 0.8.4 included, and has shipped through 0.8.16,
so any version above 0.8.4 can only have come from the live one.
A package is a Nim toolchain version, and every declared verb agrees on it:
the bare form installs one, remove and update each take one, and the
listing prints one per row. This is the reading rustup settled, where the
object the verbs agree on is what counts as a package. Nim libraries are a
different object on a different tool, and mpm reaches them through
nimble, which is why choosenim claims no purl type: a
pkg:nim/... names a nimble library, never a compiler release.
Parsing notes, verified against choosenim 0.8.4 and 0.8.16 on Linux:
--installedis what makes the inventory readable with one pattern. A bareversionsprints anInstalled:section followed by anAvailable:one, and nothing in a row says which section holds it; passing the flag drops the second section outright, so every row left is installed. It also spares a network round-trip, the catalog being fetched only without it.No
installed_versionis captured, deliberately, followingbob,pyenvandrustup. The token is the identity, and a second named group cannot capture the same span anyway. mpm treats the installed version as optional throughout.Every row is indented under a right-aligned label, and that label is the
*marking the selected version. The pattern accepts it and drops it, sinceremoveandupdatetake the bare version.The first character of the token is what rejects the furniture. A row is either a release (
2.2.10) or a nimble special version (#devel), while every other line of the listing is aChannel:,Installed:orAvailable:label, or thestablea channel resolves to. Requiring a digit or a#keeps all four out without pinning the label width.The
(latest)suffix on the newest release is left out of the id by stopping the token at the first space.--noColoris load-bearing rather than tidiness. choosenim writes SGR escapes whether or not it holds a terminal, and ignoresNO_COLOR, both verified. The escapes wrap the label, so they sit between the indentation and the version and no pattern could step over them the waybob’s does. The flag failing is not a silent risk: choosenim rejects an unknown flag outright withError: Unknown flag: ..., so a rename would fail loudly instead of quietly emptying the inventory.A search here is broader than it looks, because the ids are versions. mpm’s default matching is fuzzy and counts any alphanumeric segment of the query, so
2.0.16splits into2,0and16and matches nearly every Nim release.--exactis what narrows it to one.No
outdated: nothing reports staleness per version.(latest)marks the newest release rather than an upgrade, and the(update available!)marker choosenim does print is appended to the selected channel, which is one line about ambient state rather than a package the listing enumerates.
Caution
remove refuses the selected toolchain, exiting 1 with Error: Cannot remove current version., and the bare install form selects whatever it
installs. So a version mpm just installed can never be the one it removes
next, and cleaning up an older toolchain is the path that works. mpm
declares the operation regardless, that being the case users actually reach
for; the refusal surfaces as a normal failure. Switching away first to force
it through was rejected: choosing a Nim version is the user’s decision, not a
side effect mpm should smuggle into a removal.
Caution
No upgrade_all, and the two candidates are both traps. A bare update
refuses to run at all (Error: Expected 1 parameter to 'update' command'),
and update self replaces the choosenim binary rather than any Nim it
installed, which is the same shape as rustup’s self-update and zvm upgrade. Only the per-version form is mapped.
Note
choosenim used to block on an interactive telemetry prompt the first time it
ran, which no unattended caller could answer. 0.8.16 compiles the whole
analytics block out behind a when false: carrying a TODO to re-enable it, so
the prompt is gone for now. CHOOSENIM_NO_ANALYTICS is set regardless: it is
honored by every release that has the prompt, it opts out rather than in where
--yes would have agreed to be tracked, and it keeps mpm unattended on the day
that TODO is acted on.
No escalation: choosenim installs under ~/.choosenim and has no system-wide
mode. No sync and no cleanup: neither exists, the catalog being fetched
inline by the commands that need it.
What mpm adds to choosenim¶
Through mpm, choosenim gains --exact and --extended search, to narrow to exact names or match descriptions.
Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover choosenim alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.
Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.
Your choosenim commands, in mpm¶
You already know choosenim: each operation maps one-to-one onto mpm, in an interface shared by every manager.
To… |
With |
With |
|---|---|---|
List what’s installed |
|
|
Search for a package |
|
|
Install a package |
|
|
Upgrade one package |
|
|
Remove a package |
|
|
Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Operations¶
Operation |
Supported |
Notes |
|---|---|---|
|
✓ |
|
|
||
|
||
|
✓ |
exact and extended search backfilled by |
|
✓ |
|
|
✓ |
|
|
||
|
✓ |
|
|
||
|
||
|
Selecting and configuring choosenim¶
Deselect choosenim for a single run with --no-choosenim, or persist the choice in your configuration:
[mpm]
choosenim = false
The arguments and environment variables listed in the box atop this page are forced on every choosenim call, so runs stay quiet, non-interactive and reproducible: the defaults you would set in CI anyway.
Keep it enabled but tune how mpm drives it with a per-manager override:
[mpm.managers.choosenim]
timeout = 900
mpm config-template choosenim prints every overridable attribute as a ready-to-paste block.
Recipes¶
A few jobs you would otherwise script around choosenim, one mpm command each:
Snapshot and clone a machine:
mpm --choosenim dump choosenim.toml, thenmpm restore choosenim.tomlon the next one.Export a compliance SBOM:
mpm --choosenim sbom(CycloneDX by default,--spdxfor SPDX).
Privilege escalation¶
mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.
None of its operations needs root.
See privilege escalation for the full policy.
Cooldown¶
State of Nim choosenim’s release-age gating, from the cooldown support table:
Status: ❌ None (the catalog is a git tag list, which carries no publication date)
A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:
Registry: Nim release archive
Retraction: Archive removal: a compiler is a tarball on nim-lang.org, so a version is withdrawn by that archive ceasing to serve it, with the tag list the catalog reads regenerated to match
Publish date: ❌ the catalog is the git tag list of nim-lang/Nim, whose dates whoever cut the tag sets rather than a server
With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --cooldown best-effort opts back in.
Version probe¶
The version is probed by running:
$ choosenim --version
choosenim v0.8.16 (2025-07-12 02:03:47) [linux/amd64]
and extracted with:
r"^choosenim v?(?P<version>\S+)"
Reference traces¶
Raw native outputs captured in the bundled definition: the reference mpm’s parsers were written against. If you know Nim choosenim well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ choosenim versions --installed
Channel: stable
Installed:
* 2.2.10 (latest)
1.6.20
Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --choosenim installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.
Changelog¶
8.0.0.dev0(unreleased)Add choosenim Nim toolchain installer, with inventory, catalog search, install, remove and single-version upgrade.