# 使用 Homebrew, apk, chocolatey, MacPorts, Nix, pacman, apt, zypper, scoop 安装 nim

查看 nim 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:nim
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install nim
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nim
```

  证据: MacPorts ports tree: lang/nim/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add nim
```

  证据: Alpine Linux edge package indexes: nim from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#nim
```

  证据: nixpkgs package indexes: pkgs/by-name/ni/nim/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S nim
```

  证据: Arch Linux sync databases: nim from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- Ubuntu apt (92%):

```sh
sudo apt install nim
```

  证据: Ubuntu 24.04 LTS package indexes: nim from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz

- zypper (92%):

```sh
sudo zypper install nim
```

  证据: openSUSE Tumbleweed package metadata: nim from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install nim
```

  证据: Chocolatey community package catalog: nim from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='9.151999','cports'

- Scoop (92%):

```sh
scoop install main/nim
```

  证据: Scoop official bucket manifest trees: bucket/nim.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:nim
- **软件包管理器:** Homebrew
- **版本:** 2.2.10
- **来源摘要:** Statically typed compiled systems programming language
- **主页:** <https://nim-lang.org/>
- **仓库:** <https://github.com/nim-lang/Nim>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- nim (别名)
- nimble (别名)
- nimgrep (别名)
- nimpretty (别名)
- nimsuggest (别名)
- testament (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.2.10
## 项目历史与用法

Nim is a statically typed compiled systems programming language that tries to combine Python-like readability, compile-time metaprogramming, native performance, and practical interop through C, C++, Objective-C, and JavaScript backends. The Homebrew package installs the compiler plus the everyday toolchain pieces such as Nimble, nimgrep, nimpretty, nimsuggest, and testament.

### 项目历史

The project was known as Nimrod before the official rename to Nim in version 0.10.2 on December 29, 2014. That release also renamed the package manager from Babel to Nimble and described Nimble as a functional cross-platform installer for Nim libraries and applications backed by a GitHub-hosted package repository.

Nim 1.0 was released on September 23, 2019. The release announcement framed it as the beginning of a stable base and a long-term-supported 1.0 branch, with a commitment that code compiling under Nim 1.0 should continue to compile under stable Nim 1.x releases, subject to documented exceptions. The same announcement said more than 500 people had contributed and that Nimble packages had passed the 1,000-package milestone in August 2019.

Nim 2.0 was released on August 1, 2023, with major work around ARC/ORC memory management and toolchain changes. Nim 2.2.10 followed on April 24, 2026 as the fifth patch release for stable Nim 2.2, with 76 commits of bug fixes and improvements.

### 采用历史

Nim's adoption has been steady rather than explosive: a self-hosted compiler, a package registry through Nimble, official forums and docs, and enough package-manager presence to make it easy to install on Unix-like systems and Windows package managers. It attracts users who want native binaries, low-level control, macros, and C/C++ interop without writing C++ directly.

On 2026-07-01, Homebrew listed Nim 2.2.10 with 16,428 installs over 365 days and 16,088 installs-on-request. That is a small-language signal, but it is substantial for a non-mainstream systems language and reflects use by people building local compilers, tools, and experiments.

### 使用方式

The core workflow is still compact: write `.nim`, run `nim c myproject.nim` for a debug build, use `nim c -d:release myproject.nim` for optimized release builds, and rely on generated C or C++ plus the host compiler for final code generation. The compiler guide documents cross-compilation, C/C++ compiler selection, nimcache behavior, Android/iOS cases, DLL/shared-library generation, and backend-specific switches.

Package nerds care about Nimble because it makes Nim feel like a small language distribution rather than just a compiler. Nimble installs libraries and applications by package name or repository URL, while tools such as nimpretty, nimsuggest, nimgrep, and testament support formatting, editor integration, search, and test running.

### 为什么软件包爱好者会关心

Nim is interesting in package databases because it straddles language runtime, compiler, package manager, transpiler, and native-tool authoring platform. The package is not only a command named `nim`; it is an ecosystem bootstrapper whose adoption is tied to Nimble packages, editor integrations, and a compiler that delegates portability to mature C/C++ toolchains.

### 时间线

- {'date': '2014-12-29', 'event': 'Version 0.10.2 completed the rename from Nimrod to Nim and Babel to Nimble.'}
- {'date': '2019-08', 'event': 'The project reported passing 1,000 Nimble packages.'}
- {'date': '2019-09-23', 'event': 'Nim 1.0 released with a stable-base guarantee for the 1.x line.'}
- {'date': '2023-08-01', 'event': 'Nim 2.0 released with ARC/ORC refinements and toolchain changes.'}
- {'date': '2026-04-24', 'event': 'Nim 2.2.10 released as a stable 2.2 patch release.'}

### Related projects

- Nimble
- choosenim
- Atlas
- nimsuggest
- nimpretty
- testament

### 来源

- <https://formulae.brew.sh/formula/nim>
- <https://nim-lang.org/blog/2014/12/29/version-0102-released.html>
- <https://nim-lang.org/blog/2019/09/23/version-100-released.html>
- <https://nim-lang.org/blog/2023/08/01/nim-v20-released.html>
- <https://nim-lang.org/blog/2026/04/24/nim-2210.html>
- <https://nim-lang.org/docs/nimc.html>
- <https://nim-lang.org/documentation.html>


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.config/nim/config.nims, config.nims, <project>.nims
- Windows: %APPDATA%\nim\config.nims, config.nims, <project>.nims
## 其他软件包管理器记录

- Nix - nim: normalized package name match | nixpkgs package indexes: pkgs/by-name/ni/nim/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - nim - 1.6.14-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: nim from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Nim programming language - compiler | https://nim-lang.org/
- Ubuntu apt - nim-doc - 1.6.14-1ubuntu2: normalized package name match | Ubuntu 24.04 LTS package indexes: nim-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Nim programming language - documentation | https://nim-lang.org/
- apk - nim - 2.2.0-r0: normalized package name match | Alpine Linux edge package indexes: nim from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A systems and applications programming language | https://nim-lang.org/
- apk - nim-dbg - 2.2.0-r0: normalized package name match | Alpine Linux edge package indexes: nim-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A systems and applications programming language (debug build) | https://nim-lang.org/
- apk - nim-dev - 2.2.0-r0: normalized package name match | Alpine Linux edge package indexes: nim-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A systems and applications programming language (development files) | https://nim-lang.org/
- apk - nim-gdb - 2.2.0-r0: normalized package name match | Alpine Linux edge package indexes: nim-gdb from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A systems and applications programming language (gdb printers) | https://nim-lang.org/
- apk - nimsuggest - 2.2.0-r0: normalized package name match | Alpine Linux edge package indexes: nimsuggest from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | idetools for the nim language | https://nim-lang.org/
- pacman - nim - 2.2.10-1: normalized package name match | Arch Linux sync databases: nim from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Imperative, multi-paradigm, compiled programming language | https://nim-lang.org/
- zypper - nim - 2.2.10-1.3: normalized package name match | openSUSE Tumbleweed package metadata: nim from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A statically typed compiled systems programming language | https://nim-lang.org/
- MacPorts - nim: normalized package name match | MacPorts ports tree: lang/nim/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - nim: normalized package name match | Chocolatey community package catalog: nim from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='9.151999','cports'
- Scoop - main/nim: normalized package name match | Scoop official bucket manifest trees: bucket/nim.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- Nix - nimble: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/ni/nimble/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - nimble - 0.14.2-r0: installed executable or alias match | Alpine Linux edge package indexes: nimble from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Package manager for the Nim programming language | https://github.com/nim-lang/nimble
- apk - nimble-bash-completion - 0.14.2-r0: installed executable or alias match | Alpine Linux edge package indexes: nimble-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for nimble | https://github.com/nim-lang/nimble


## Combined YAML source

View the package source record on GitHub. [combined/nim.yml](https://github.com/mxcl/pkgdb/blob/main/combined/nim.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
