macOS
brew install alejandralocal Homebrew formula metadata
安装
brew install alejandralocal Homebrew formula metadata
nix profile install nixpkgs#alejandranixpkgs package indexes · pkgs/by-name/al/alejandra/package.nix · 来源: api.github.com
概览
Command-line tool for formatting Nix Code
历史
Alejandra is a Rust-based formatter for the Nix expression language. It is part of the Nix ecosystem's formatter wars: small, opinionated, fast, and built to make style disappear from code review.
The official README brands Alejandra as 'The Uncompromising Nix Code Formatter' and says it was written in Rust, formats Nixpkgs in seconds, and starts from the original Nixpkgs style refined by feedback from developers using Nix at scale.
The changelog shows a fast maturation arc in 2022. Version 1.0.0 shipped in March 2022; 1.4.0 and 1.5.0 followed with pre-commit support and dependency updates; 2.0.0 in July 2022 added a style guide, editor integration docs, and publication as a Rust crate with API docs; 3.0.0 in August 2022 simplified the CLI and improved large-file formatting order.
Later releases kept the formatter active in normal toolchain maintenance. Version 3.1.0 in 2024 refreshed integration docs and pre-commit hooks, and 4.0.0 in 2025 added experimental configurable indentation and support for newer Nix pipe operators.
Alejandra's official README documents installation from Nixpkgs, Nix flakes, NixOS configurations, Homebrew, and prebuilt binaries. The supplied package facts also list Homebrew and Nix packages, which fits its primary audience: people already managing tools declaratively.
The README lists integrations for VS Code, Vim, Neovim, GNU Emacs, Doom Emacs, pre-commit, and pre-commit-hooks.nix. That adoption history matters because formatters become useful only when they are cheap to run in editors, CI, and repository hooks.
Users run `alejandra` against Nix files, stdin, or repository trees, and often wire it into editor format-on-save or pre-commit hooks. The project treats the CLI, formatting rules, flags, exit codes, and stdout as its public API under semantic versioning.
Configuration is intentionally limited. The README documents an experimental `alejandra.toml` discovered in the current working directory, or supplied explicitly with `--experimental-config`.
Alejandra is a package-nerd package because it formats the language used to describe packages in Nix. It is both a normal CLI package and a tool that shapes the readability of package expressions.
It also has the useful distribution trifecta for developer tools: Rust source, prebuilt binaries, and native Nix/Homebrew packaging, plus editor and hook integrations.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
local files
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.
Config paths the tool may read or write during local use.
alejandra.toml可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
alejandra | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/kamadorueda/alejandra
安装元数据
| 软件包键 | brew:alejandra |
|---|---|
| 版本 | 4.0.0 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/alejandra |
| 主页 | https://kamadorueda.com/alejandra/ |
| 仓库 | https://github.com/kamadorueda/alejandra |
| 上游文档 | https://github.com/kamadorueda/alejandra#readme |
| 许可证 | Unlicense |
| 源码归档 | https://github.com/kamadorueda/alejandra/archive/refs/tags/4.0.0.tar.gz |
| 构建依赖 | rust |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | alejandra |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
alejandra
nix profile install nixpkgs#alejandra来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.