# nixfmt を Homebrew, Nix でインストール

nixfmt のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

```sh
sudo av install brew:nixfmt
```

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install nixfmt
```

  証拠: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#nixfmt
```

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

## パッケージ情報

- **パッケージキー:** brew:nixfmt
- **パッケージマネージャ:** Homebrew
- **パッケージマネージャページ:** <https://formulae.brew.sh/formula/nixfmt>
- **バージョン:** 1.4.0
- **ソース概要:** Command-line tool to format Nix language code
- **ホームページ:** <https://github.com/NixOS/nixfmt>
- **リポジトリ:** <https://github.com/NixOS/nixfmt>
- **上流ドキュメント:** <https://github.com/NixOS/nixfmt#readme>
- **ライセンス:** MPL-2.0
- **ソースアーカイブ:** <https://github.com/NixOS/nixfmt/archive/refs/tags/v1.4.0.tar.gz>
- **最終更新:** 2026-07-08T03:18:41Z
- **生成日時:** 2026-07-08T18:08:21+00:00

## 実行可能ファイル

- nixfmt (cli)
- nixfmt (エイリアス)

## 依存関係

- gmp

## ビルド依存関係

- cabal-install
- ghc

## macOS 提供ライブラリ

- libffi

## インストール挙動

- post-install フック: 未定義
- Bottle: 利用可能 対象 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## バージョンと鮮度

- ページ生成日: 2026-07-08
- マネージャ版: 1.4.0
- マネージャ更新日: 2026-07-08
- ローカルデータ: OK
- 上流リポジトリ: https://github.com/NixOS/nixfmt
- 検出された最新: v1.4.0 (最新)
## プロジェクトの歴史と使われ方

nixfmt is the official formatter for Nix language code. It started as a formatter project, was donated into the NixOS organization, and became the reference implementation for the standard Nix format defined by RFC 166.

### プロジェクトの歴史

The nixfmt changelog lists version 0.1.0 on May 11, 2019 as the first release and says it could parse all of nixpkgs and format it consistently, though not yet prettily in all places. The repository README later acknowledged that nixfmt was originally developed by Serokell and donated to become an official Nix project after RFC 166.

RFC 166 was merged on March 5, 2024. The RFC text on the pull request set out to define the initial standard Nix format, establish the Nix formatter team, create the official implementation, reformat Nixpkgs, and require default formatting in the Nix CLI to use the official formatter. nixfmt 1.0.0 was released on July 9, 2025 as the first stable release of the official formatter, with the changelog noting that formatting changed substantially from earlier nixfmt output.

### 採用の歴史

nixfmt's adoption is institutional inside the Nix ecosystem rather than measured only by direct installs. The README calls it the official formatter, says the standard is defined in `standard.md`, and documents editor integration, NixOS/Home Manager installation, `nixfmt-tree`, `treefmt-nix`, direct `treefmt`, and `git-hooks.nix` workflows.

On 2026-07-01, Homebrew listed nixfmt 1.3.1 with 1,388 installs over 365 days. That undercounts its real ecosystem role because many Nix users get it from Nixpkgs and invoke it through flakes, `nix fmt`, treefmt wrappers, editor integrations, or pre-commit hooks.

### 使われ方

The bare CLI is simple: `nixfmt < input.nix` formats stdin to stdout, and `nixfmt file.nix` formats a file in place. The README notes that `nixfmt` itself processes one file at a time and points project-level users toward wrappers such as `nixfmt-tree`, `treefmt-nix`, `treefmt`, and `git-hooks.nix`.

For flake-based workflows, the Nix manual documents `nix fmt` as rewriting Nix files to a canonical format using the formatter specified in the flake, including examples that set the formatter to `nixfmt`. That is the package-nerd adoption path: wire nixfmt into the flake, editor, or pre-commit hook and stop arguing about style.

### パッケージ好きにとっての重要性

nixfmt matters because Nix formatting moved from preference and competing tools toward a source-backed standard with a maintained official implementation. For package databases, it is a clean example of a developer tool whose status changed through governance: Serokell project, RFC-defined standard, NixOS-org repository, then official stable formatter.

### タイムライン

- {'date': '2019-05-11', 'event': 'nixfmt 0.1.0 first release.'}
- {'date': '2024-03-05', 'event': 'RFC 166 merged.'}
- {'date': '2025-07-09', 'event': 'nixfmt 1.0.0 released as the first stable official formatter.'}
- {'date': '2026-07-01', 'event': 'Homebrew formula listed stable nixfmt 1.3.1.'}

### Related projects

- Nix
- Nixpkgs
- nixfmt-tree
- treefmt
- treefmt-nix
- git-hooks.nix

### ソース

- <https://formulae.brew.sh/formula/nixfmt>
- <https://github.com/NixOS/nixfmt>
- <https://github.com/NixOS/nixfmt/blob/master/CHANGELOG.md>
- <https://github.com/NixOS/nixfmt/blob/master/standard.md>
- <https://github.com/NixOS/rfcs/pull/166>
- <https://nix.dev/manual/nix/2.23/command-ref/new-cli/nix3-fmt>


## セキュリティノート

narrow executable package without higher-risk signals.

- **Geiger リスク:** グリーン / 低
- narrow executable package without higher-risk signals

## ソースデータベース詳細

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** nixfmt
- **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:** head, stable

## 他のパッケージマネージャ記録

- Nix - nixfmt: normalized package name match | nixpkgs package indexes: pkgs/by-name/ni/nixfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 関連リンク

- [Source-control packages](https://www.automicvault.com/ja/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/ja/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/ja/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/ja/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [cabal-install](https://www.automicvault.com/ja/pkg/brew/cabal-install/) - Build dependency declared by Homebrew.
- [ghc](https://www.automicvault.com/ja/pkg/brew/ghc/) - Build dependency declared by Homebrew.
- [alejandra](https://www.automicvault.com/ja/pkg/brew/alejandra/) - Shares av.db curated category or tags: cli, developer-tools, formatter, nix.
- [dfmt](https://www.automicvault.com/ja/pkg/brew/dfmt/) - Shares av.db curated category or tags: cli, code-formatter, developer-tools, formatter.
- [elm-format](https://www.automicvault.com/ja/pkg/brew/elm-format/) - Shares av.db curated category or tags: cli, code-formatter, developer-tool, developer-tools, formatter.
- [fracturedjson](https://www.automicvault.com/ja/pkg/brew/fracturedjson/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, formatter.
- [odinfmt](https://www.automicvault.com/ja/pkg/brew/odinfmt/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, formatter.
- [ormolu](https://www.automicvault.com/ja/pkg/brew/ormolu/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, formatter.
- [sleek](https://www.automicvault.com/ja/pkg/brew/sleek/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, formatter.
- [treefmt](https://www.automicvault.com/ja/pkg/brew/treefmt/) - Shares av.db curated category or tags: cli, developer-tool, developer-tools, formatter.
- [hindent](https://www.automicvault.com/ja/pkg/brew/hindent/) - Local package facts share a topical domain. Shared terms: cli, code, developer, developer-tools, formatter.
- [smlfmt](https://www.automicvault.com/ja/pkg/brew/smlfmt/) - Local package facts share a topical domain. Shared terms: cli, code, developer, developer-tools, formatter.

## Combined YAML source

View the package source record on GitHub. [combined/nixfmt.yml](https://github.com/automic-vault/db/blob/main/combined/nixfmt.yml)


## ソース

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
