{"id":46984246,"url":"https://github.com/asdf-community/asdf-nim","last_synced_at":"2026-03-11T13:30:43.138Z","repository":{"id":45251025,"uuid":"325893721","full_name":"asdf-community/asdf-nim","owner":"asdf-community","description":"Nim plugin for the asdf version manager [maintainer=@elijahr]","archived":false,"fork":false,"pushed_at":"2026-03-04T04:20:14.000Z","size":509,"stargazers_count":27,"open_issues_count":3,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-04T09:41:31.910Z","etag":null,"topics":["asdf","asdf-plugin"],"latest_commit_sha":null,"homepage":"https://github.com/asdf-vm/asdf","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asdf-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["smorimoto"]}},"created_at":"2021-01-01T00:26:19.000Z","updated_at":"2026-03-04T04:19:44.000Z","dependencies_parsed_at":"2023-01-23T03:00:41.113Z","dependency_job_id":"3bb2ab42-44d5-420a-b0e2-16d4436c4567","html_url":"https://github.com/asdf-community/asdf-nim","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/asdf-community/asdf-nim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdf-community%2Fasdf-nim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdf-community%2Fasdf-nim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdf-community%2Fasdf-nim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdf-community%2Fasdf-nim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asdf-community","download_url":"https://codeload.github.com/asdf-community/asdf-nim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asdf-community%2Fasdf-nim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30382673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T12:49:11.341Z","status":"ssl_error","status_checked_at":"2026-03-11T12:46:41.342Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asdf","asdf-plugin"],"created_at":"2026-03-11T13:30:42.372Z","updated_at":"2026-03-11T13:30:43.118Z","avatar_url":"https://github.com/asdf-community.png","language":"Shell","funding_links":["https://github.com/sponsors/smorimoto"],"categories":[],"sub_categories":[],"readme":"[![build](https://github.com/asdf-community/asdf-nim/actions/workflows/build.yml/badge.svg)](https://github.com/asdf-community/asdf-nim/actions/workflows/build.yml) [![lint](https://github.com/asdf-community/asdf-nim/actions/workflows/lint.yml/badge.svg)](https://github.com/asdf-community/asdf-nim/actions/workflows/lint.yml)\n\n# asdf-nim\n\nasdf-nim allows you to quickly install any version of [Nim](https://nim-lang.org).\n\nasdf-nim works for both personal development and continuous integration. It runs on macOS and Linux, supporting x86, ARM, and other architectures.\n\n## Installation\n\n[Install asdf](https://asdf-vm.com/guide/getting-started.html), then:\n\n```sh\nasdf plugin add nim # install the asdf-nim plugin\nasdf nim install-deps  # install system-specific dependencies for downloading \u0026 building Nim\n```\n\n### To install Nim:\n\nWhen available for the version and platform, the plugin will install pre-compiled binaries of Nim. If no binaries are available the plugin will build Nim from source.\n\n```sh\n# latest stable version of Nim\nasdf install nim latest\n# or latest stable minor/patch release of Nim 2.x.x\nasdf install nim latest:2\n# or latest stable patch release of Nim 2.2.x\nasdf install nim latest:2.2\n# or specific patch release\nasdf install nim 2.2.0\n```\n\n### To install a nightly build of Nim:\n\nPre-built nightly binaries are available for some platforms and branches:\n\n```sh\n# nightly unstable build of devel branch (pre-built binaries available for most platforms)\nasdf install nim ref:devel\n# or nightly unstable build of version-2-2 branch (pre-built binaries available for most platforms)\nasdf install nim ref:version-2-2\n# or nightly unstable build of version-2-0 branch (pre-built binaries available for most platforms)\nasdf install nim ref:version-2-0\n```\n\nFor older versions, the plugin will build from source (no pre-built nightly binaries):\n\n```sh\n# build from version-1-6 branch source (no pre-built nightlies available)\nasdf install nim ref:version-1-6\n```\n\n### To build a specific git commit or branch of Nim:\n\n```sh\n# build using latest commit from the devel branch\nasdf install nim ref:HEAD\n# build using the specific commit 7d15fdd\nasdf install nim ref:7d15fdd\n# build using the tagged release v2.2.0\nasdf install nim ref:v2.2.0\n```\n\n### To set the default version of Nim for your user:\n\n```sh\nasdf set --home nim latest:2.2\n```\n\nThis creates a `.tool-versions` file in your home directory specifying the Nim version.\n\n### To set the version of Nim for a project directory:\n\n```sh\ncd my-project\nasdf set nim latest:2.2\n```\n\nThis creates a `.tool-versions` file in the current directory specifying the Nim version. For additional plugin usage see the [asdf documentation](https://asdf-vm.com/#/core-manage-asdf).\n\n## Nimble packages\n\nIn addition to global nimble package installation, asdf-nim works as expected with a[`nimbledeps`](https://github.com/nim-lang/nimble/issues/131#issuecomment-676624533) directory and the [atlas](https://github.com/nim-lang/atlas) package cloner.\n\n## Continuous Integration\n\n### A simple example using GitHub Actions:\n\n```yaml\nname: Build\non:\n  push:\n    paths-ignore:\n      - README.md\n\nenv:\n  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\njobs:\n  build:\n    name: Test\n    runs-on: ${{ matrix.os }}\n    matrix:\n      include:\n        # Test against stable Nim builds on linux\n        - os: ubuntu-latest\n          nim-version: latest:2.2\n        - os: ubuntu-latest\n          nim-version: latest:1.6\n\n        # Test against unstable nightly Nim builds on macos x64 (faster than building from source)\n        - os: macos-latest\n          nim-version: ref:version-2-2\n        - os: macos-latest\n          nim-version: ref:version-1-6\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - name: Install Nim\n        uses: asdf-vm/actions/install@v4\n        with:\n          tool_versions: |\n            nim ${{ matrix.nim-version }}\n      - name: Run tests\n        run: |\n          asdf set nim ${{ matrix.nim-version }}\n          nimble develop -y\n          nimble test\n          nimble examples\n```\n\n### Continuous Integration on Non-x86 Architectures\n\nUsing [uraimo/run-on-arch-action](https://github.com/uraimo/run-on-arch-action):\n\n```yaml\nname: Build\non:\n  push:\n    paths-ignore:\n      - README.md\n\njobs:\n  test_non_x86:\n    name: Test nim-${{ matrix.nim-version }} / debian-buster / ${{ matrix.arch }}\n    strategy:\n      fail-fast: false\n      matrix:\n        include:\n          - nim-version: ref:version-2-2\n            arch: armv7\n          - nim-version: ref:version-1-6\n            arch: aarch64\n\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Nim project\n        uses: actions/checkout@v4\n\n      - uses: uraimo/run-on-arch-action@v3\n        name: Install Nim \u0026 run tests\n        with:\n          arch: ${{ matrix.arch }}\n          distro: bookworm\n\n          dockerRunArgs: |\n            --volume \"${HOME}/.cache:/root/.cache\"\n            --volume \"${GITHUB_WORKSPACE}:/workspace\"\n\n          setup: mkdir -p \"${HOME}/.cache\"\n\n          shell: /usr/bin/env bash\n\n          install: |\n            set -uexo pipefail\n\n            # Add Debian backports repository for newer Golang versions\n            cat \u003e/etc/apt/sources.list.d/debian-backports.sources \u003c\u003cEOF\n            Types: deb deb-src\n            URIs: http://deb.debian.org/debian\n            Suites: bookworm-backports\n            Components: main\n            Enabled: yes\n            Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg\n            EOF\n\n            # Install dependencies\n            apt-get update -q -y\n            apt-fast install -qq -y curl git xz-utils build-essential\n            apt-fast install -qq -y -t bookworm-backports golang-go\n            go install github.com/asdf-vm/asdf/cmd/asdf@master\n\n            # Install asdf-nim\n            export PATH=\"/root/go/bin:${PATH}\"\n            asdf plugin add nim\n            asdf nim install-deps -y\n\n          env: |\n            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n          run: |\n            set -uexo pipefail\n\n            cd /workspace\n\n            # Install Nim\n            asdf install nim ${{ matrix.nim-version }}\n            asdf set nim ${{ matrix.nim-version }}\n\n            # Run tests\n            nimble develop -y\n            nimble test\n            nimble examples\n```\n\n## Stable binaries\n\n[nim-lang.org](https://nim-lang.org/install.html) supplies pre-compiled stable binaries of Nim for:\n\nLinux:\n\n- `x86_64`\n- `x86`\n\n## Exact version matching via nightly builds\n\nFor platforms without official stable binaries (ARM Linux, macOS, etc.), the plugin automatically finds and uses exact nightly builds matching the requested stable version.\n\nWhen you install a specific version like `2.2.4` on a platform without official binaries:\n\n```sh\nasdf install nim 2.2.4\n```\n\nThe plugin will:\n\n1. Check for official stable binaries (x86_64/x86 Linux only)\n2. If none available, search for exact nightly builds matching the version's commit hash\n3. Use the matching nightly build (typically built within 1-2 days of the release)\n4. Fall back to building from source if no exact nightly found\n\nThis means **ARM users get exact stable versions in seconds instead of minutes** building from source.\n\n### Opt-out\n\nTo always build from source instead of using exact nightly matches:\n\n```sh\nexport ASDF_NIM_NO_NIGHTLY_FALLBACK=1\nasdf install nim 2.2.4\n```\n\n## Unstable nightly binaries\n\n[nim-lang/nightlies](https://github.com/nim-lang/nightlies) supplies pre-compiled unstable binaries of Nim. This plugin automatically detects available nightly releases via the GitHub API.\n\nWhen installing a nightly version (e.g., `ref:devel` or `ref:version-2-2`), the plugin will:\n\n1. Query the GitHub releases API to find available nightly builds (checks up to 4 pages of releases)\n2. Select the most recent nightly that matches your platform and desired version\n3. Fall back to building from source if no matching prebuilt nightly is found\n\nCommon platforms with nightly support:\n\nLinux:\n\n- `x86_64`\n- `x86`\n- `aarch64`\n- `armv7l`\n\nmacOS:\n\n- `x86_64`\n- `arm64`\n\n**Note**: All Nim binaries (stable and nightly) are portable and work on both glibc-based (Ubuntu, Debian, etc.) and musl-based (Alpine Linux, etc.) systems.\n\n**Note**: To avoid GitHub API rate limits (60 requests/hour without authentication), set the `GITHUB_TOKEN` environment variable with a personal access token. The plugin will automatically use it for API requests.\n\n## Updating asdf and asdf-nim\n\n```sh\nasdf update\nasdf plugin update nim main\n```\n\n## Contributing\n\nPull requests are welcome!\n\nFork this repo, then run:\n\n```sh\nrm -rf ~/.asdf/plugins/nim\ngit clone git@github.com:\u003cyour-username\u003e/asdf-nim.git ~/.asdf/plugins/nim\n```\n\n### Testing\n\nThis project uses [bats](https://github.com/bats-core/bats-core) for unit testing. Please follow existing patterns and add unit tests for your changeset. Dev dependencies for unit tests are installed via:\n\n```shell\ncd ~/.asdf/plugins/nim\nnpm install --include=dev\n```\n\nRun tests with:\n\n```sh\nnpm run test\n```\n\n#### Test Performance Optimization\n\nFor faster local development, you can skip slow integration tests:\n\n```sh\n# Run only fast unit tests (~60s)\nASDF_NIM_SKIP_INTEGRATION=1 npm run test\n\n# Run all tests including integration tests (~5-10 min)\nnpm run test\n```\n\n**Test Types:**\n\n- **Unit tests** (`test/utils.bats`): Fast, mocked, test individual functions\n- **Integration tests** (`test/integration.bats`): Slow, install real Nim versions\n\n**CI Caching:** Integration tests cache Nim installations between runs for speed.\n\n### Linting\n\nThis project uses [pre-commit](https://pre-commit.com/) to auto-format code. Please ensure your changeset passes linting. Install and enable pre-commit with:\n\n```sh\npip install pre-commit\npre-commit install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasdf-community%2Fasdf-nim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasdf-community%2Fasdf-nim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasdf-community%2Fasdf-nim/lists"}