Skip to content

Commit 1f2589c

Browse files
authored
Merge pull request #316 from NixOS/stable-release
Release 1.0.0
2 parents 3f27e21 + 6d5941e commit 1f2589c

File tree

6 files changed

+40
-55
lines changed

6 files changed

+40
-55
lines changed

.pre-commit-hooks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
language: haskell
55
types:
66
- nix
7-
description: The official (but not yet stable) formatter for Nix code
7+
description: The official formatter for Nix code

CHANGELOG.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Revision history for nixfmt
22

3-
## Unreleased
3+
## 1.0.0 -- 2025-07-09
44

5-
* Parsing fixes
6-
* Quotes in inherit statements (like `inherit "or";`) are now supported.
5+
The [Nix Formatting Team](https://nixos.org/community/teams/formatting/) is happy to present the first stable release of the official Nix formatter! The basis for this milestone is [RFC 166](https://github.com/NixOS/rfcs/pull/166), which defined the [standard for Nix formatting](https://github.com/NixOS/nixfmt/blob/master/standard.md), established the Nix Formatting team and set the groundwork for nixfmt to become the official formatter.
6+
7+
Given that, this release is _significantly_ different from the previous one:
8+
- How Nix is formatted _completely_ changed and is unrecognisable from previous versions, fixing many issues with the old formatting in the process. It would be pointless to try to list all the differences, just think of it as an entirely new formatting.
9+
- This project graduated from a [Serokell](https://serokell.io/) project to an official Nix project, with a [repository under the NixOS org](https://github.com/nixos/nixfmt) and a community-based Nix formatting team as maintainers.
10+
11+
Other than the above, there are some notable UX changes:
12+
- Deprecate `nixfmt [dir]` for recursively formatting a directory again. Please use the new `pkgs.nixfmt-tree` wrapper instead, or <https://github.com/numtide/treefmt-nix> for more flexibility, see [the docs](https://github.com/nixos/nixfmt?tab=readme-ov-file#in-a-project) for more options.
13+
- More complete [usage documentation](https://github.com/nixos/nixfmt?tab=readme-ov-file#installation).
14+
- A [Git mergetool mode](https://github.com/nixos/nixfmt?tab=readme-ov-file#git-mergetool) is now supported.
15+
- CLI changes:
16+
- In stdin-mode, `--filename <path>` can now be used to specify a filename for diagnostics.
17+
- Number of indendation spaces can now be configured using `--indent <number>`
718

819
## 0.6.0 -- 2023-10-31
920

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ When contributing, please try to familiarize yourself with the [Nix Format Stand
77

88
You can also reach us on Matrix at `#nix-formatting:nixos.org`.
99

10+
## Development
11+
12+
Enter a development shell with `nix-shell`, `nix develop` or automatically with [direnv](https://direnv.net/), after which you can:
13+
- Build (& run): `cabal build` (`cabal run`)
14+
- Debug: `cabal repl`
15+
- Format the codebase: `treefmt`
16+
- [Set up](https://haskell-language-server.readthedocs.io/en/latest/configuration.html#configuring-your-editor) your LSP-editor to use `haskell-language-server`
17+
18+
To run (almost) all CI checks locally:
19+
```
20+
nix-build -A ci
21+
```
22+
1023
## Contributing code
1124

1225
Most changes to the format are going to be implemented in `Pretty.hs`.

MAINTENANCE.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ rather than the version from the cabalfile.
55

66
## Making a new release
77

8-
- Check the commit log if anything is missing from the change log.
9-
- Check dependency versions in `nixfmt.cabal`, bump upper bounds if possible.
10-
- Bump the version.
11-
- Give it a git tag.
12-
- Upload to hackage using `cabal sdist`. See https://hackage.haskell.org/upload for details.
8+
- Bump the version in the [cabal file](./nixfmt.cabal)
9+
- Update the [changelog](./CHANGELOG.md) with the new version
10+
- Create a PR with the above changes and merge it
11+
- Create a [new GitHub release](https://github.com/NixOS/nixfmt/releases/new) with tag matching the version and set the release notes to this versions changelog

README.md

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
# `nixfmt`
2-
3-
`nixfmt` is the official formatter for Nix language code, intended to easily apply a uniform style.
4-
51
![Build Status](https://github.com/NixOS/nixfmt/actions/workflows/main.yml/badge.svg?branch=master)
62

7-
## State
8-
9-
`nixfmt` was originally developed by [Serokell](https://github.com/serokell).
10-
It was used as the basis for the official standardised Nix formatter, as established by [RFC 166](https://github.com/NixOS/rfcs/pull/166).
11-
12-
The official standard differs considerably from the original implementation.
13-
Be aware of this if you track the [`master`](https://github.com/NixOS/nixfmt/tree/master) branch.
14-
Until the [next release](https://github.com/NixOS/nixfmt/issues/272), expect `nixfmt` to change.
3+
# Nixfmt
154

16-
A recent version of `nixfmt` is available as `pkgs.nixfmt-rfc-style` in Nixpkgs.
17-
The original `nixfmt` is still available as `pkgs.nixfmt-classic`, but it is unmaintained and will eventually be removed.
18-
19-
For more details, see the [RFC implementation tracking issue](https://github.com/NixOS/nixfmt/issues/153).
5+
Nixfmt is the official formatter for Nix language code.
6+
It is maintained by the [Nix formatting team](https://nixos.org/community/teams/formatting/).
7+
This document is the user documentation, see [CONTRIBUTING.md](./CONTRIBUTING.md) for contributor documentation.
208

219
## Installation
2210

@@ -229,9 +217,6 @@ includes = ["*.nix"]
229217

230218
6. Try to commit a badly formatted Nix file in order to make sure that everything works.
231219

232-
> [!WARNING]
233-
> `nixfmt`’s integration with the `pre-commit` tool is relatively new. At the moment, none of the stable releases of `nixfmt` can be used with the `pre-commit` tool. You’ll have to use an unstable version for the time being.
234-
235220
#### `git mergetool`
236221

237222
`nixfmt` provides a mode usable by [`git mergetool`](https://git-scm.com/docs/git-mergetool)
@@ -304,34 +289,11 @@ to return back to the unmerged state.
304289
}
305290
```
306291

307-
## Development
308-
309-
### With Nix
310-
311-
Haskell dependencies will be built by Nix.
312-
313-
* Enter `nix-shell`
314-
* Build with `cabal new-build`
315-
316-
### Without Nix
317-
318-
Haskell dependencies will be built by Cabal.
319-
320-
* Build with `cabal new-build`
321-
322-
323292
## Usage
324293

325294
* `nixfmt < input.nix` – reads Nix code from `stdin`, formats it, and outputs to `stdout`
326295
* `nixfmt file.nix` – format the file in place
327296

328-
## About Serokell
329-
330-
`nixfmt` is maintained and funded with :heart: by
331-
[Serokell](https://serokell.io/). The names and logo for Serokell are trademark
332-
of Serokell OÜ.
297+
## Acknowledgements
333298

334-
We love open source software! See
335-
[our other projects](https://serokell.io/community?utm_source=github) or
336-
[hire us](https://serokell.io/hire-us?utm_source=github) to design, develop and
337-
grow your idea!
299+
`nixfmt` was originally developed by [Serokell](https://github.com/serokell) and later donated to become an official Nix project with the acceptance of [RFC 166](https://github.com/NixOS/rfcs/pull/166).

nixfmt.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 2.0
22
name: nixfmt
3-
version: 0.6.0
4-
synopsis: Official formatter for Nix code
3+
version: 1.0.0
4+
synopsis: Official formatter for Nix code
55
description:
66
A formatter for Nix that ensures consistent and clear formatting by forgetting
77
almost all existing formatting during parsing.

0 commit comments

Comments
 (0)