# nix-mode

> Emacs major mode for editing Nix expressions

**Wikidata**: [Q115581679](https://www.wikidata.org/wiki/Q115581679)  
**Source**: https://4ort.xyz/entity/nix-mode

## Summary
nix-mode is an Emacs major mode designed for editing Nix expressions. Written in Emacs Lisp, it serves as a software library for the GNU Emacs platform, facilitating the development and management of Nix packages. It is free software available under the GNU Lesser General Public License.

## Key Facts
- **Type:** Emacs major mode (software library).
- **Primary Use:** Editing Nix expressions.
- **Platform:** GNU Emacs.
- **Programming Language:** Emacs Lisp.
- **License:** GNU Lesser General Public License, version 2.1.
- **Latest Stable Version:** 1.5.0 (released December 2, 2022).
- **Maintainer:** Matthew Bauer.
- **Aliases:** emacs-nix-mode.
- **Distribution:** Part of NonGNU ELPA (since January 29, 2022).
- **Source Repository:** Hosted on GitHub at `https://github.com/NixOS/nix-mode`.

## FAQs

### Q: What is nix-mode used for?
nix-mode is used to edit Nix expressions within the GNU Emacs text editor. It provides syntax highlighting and tooling for the Nix functional language, which is used for package management and system configuration.

### Q: How is nix-mode licensed?
It is distributed as free software under the GNU Lesser General Public License, version 2.1 (LGPL-2.1).

### Q: Where can nix-mode be installed?
It is available through the NonGNU Emacs Lisp Package Archive (ELPA) and can be found on GitHub. It became part of NonGNU ELPA on January 29, 2022.

## Why It Matters
nix-mode plays a critical role in the developer experience for users of the Nix package manager and NixOS within the Emacs ecosystem. As Nix utilizes a unique lazy functional language for defining packages and configurations, a specialized major mode is essential for efficient editing. nix-mode provides the necessary syntax highlighting and structural support that standard text editing configurations lack.

By integrating with GNU Emacs, it allows developers to leverage the editor's extensibility while writing Nix expressions. Its inclusion in NonGNU ELPA since early 2022 signifies its status as a standard, trusted tool within the Emacs community, ensuring broad accessibility without requiring third-party repository configuration. The project is actively maintained, with recent updates ensuring compatibility and feature expansion for modern Nix workflows.

## Notable For
- **Official ELPA Inclusion:** It is a distinct software library distributed via the NonGNU Emacs Lisp Package Archive.
- **Specialized Utility:** Specifically targets Nix expression editing, a niche functional language for package management.
- **Active Maintenance:** The project has seen consistent updates, with version 1.5.0 released in late 2022.
- **Open Source:** It is free software maintained by Matthew Bauer and hosted openly on GitHub.

## Body

### Development and History
nix-mode is maintained by Matthew Bauer and is written in Emacs Lisp. The project serves as a fundamental tool for developers utilizing the Nix language within GNU Emacs.

Historically, the mode was distributed independently but achieved a significant milestone on January 29, 2022, when it was officially included in the NonGNU ELPA distribution. This inclusion simplified installation for a vast number of Emacs users.

### Version Timeline
The development of nix-mode has been tracked through numerous stable releases hosted on GitHub and announced via mailing lists. Key release dates include:
- **v1.2.0:** Released August 12, 2017.
- **v1.3.0:** Released December 12, 2018.
- **v1.4.0:** Released June 14, 2019.
- **v1.4.4:** Released January 29, 2022.
- **v1.4.5:** Released September 7, 2020.
- **v1.5.0:** The most recent stable version noted, released December 2, 2022.

### Technical Properties
- **Source Code:** The primary repository is located at `https://github.com/NixOS/nix-mode.git`. It is also mirrored/distributed via Gitweb on GNU Savannah.
- **Copyright:** The software is copyrighted but freely distributed.
- **System Integration:** It is identified by the Guix variable name `emacs-nix-mode` and operates on the GNU Emacs platform.

## References

1. [Source](https://elpa.nongnu.org/nongnu/nix-mode.html)
2. [Nix-Mode version 1.4.4. 2022](https://lists.gnu.org/archive/html/gnu-emacs-sources/2022-01/msg00104.html)
3. [Nix-Mode version 1.5.0. 2022](https://lists.gnu.org/archive/html/gnu-emacs-sources/2022-12/msg00003.html)
4. [Release 1.2.0. 2017](https://github.com/NixOS/nix-mode/releases/tag/v1.2.0)
5. [Release 1.2.1. 2017](https://github.com/NixOS/nix-mode/releases/tag/v1.2.1)
6. [Release 1.2.2. 2018](https://github.com/NixOS/nix-mode/releases/tag/v1.2.2)
7. [Release 1.3.0. 2018](https://github.com/NixOS/nix-mode/releases/tag/v1.3.0)
8. [Release 1.4.0. 2019](https://github.com/NixOS/nix-mode/releases/tag/v1.4.0)
9. [Release 1.4.1. 2019](https://github.com/NixOS/nix-mode/releases/tag/v1.4.1)
10. [Release 1.4.2. 2020](https://github.com/NixOS/nix-mode/releases/tag/v1.4.2)
11. [Release 1.4.5. 2020](https://github.com/NixOS/nix-mode/releases/tag/v1.4.5)