The Nix programming language is a functional and declarative domain-specific language designed for creating and composing derivations, primarily used in the context of package management and system configuration.
The language is designed for conveniently creating and composing derivations, which are precise descriptions of how the contents of existing files are used to derive new files. Nix is a domain-specific language that integrates seamlessly with the Nix package manager, which manages files and performs the derivations declared in the Nix language. Unlike traditional package managers, Nix takes a novel approach by ensuring reproducibility, immutability, and isolation.
Nix expressions written in the Nix language describe package dependencies, build steps, and outputs. The Nix package manager uses them to create and manage packages. The package manager relies on the Nix programming language to define and express package specifications. When a package is created in Nix, expressions can be written in the Nix language. Nix expressions serve as blueprints for building packages, which the package manager evaluates to determine how to fetch, compile, and install software. The package manager and the language work together.
NixOS is a Linux distribution built entirely around Nix for system configuration. NixOS uses Nix expressions to define the entire system configuration declaratively, allowing users to express their system setup, including packages, services, and configurations, in a consistent manner.
Nix and NixOS form a powerful combination. Nix provides the package management infrastructure, while NixOS extends it to manage the entire system configuration in a declarative and reproducible manner.
The Nix programming language is a lazy, almost pure functional language. It emphasizes immutability and declarative expressions. Its lazy evaluation allows for efficient and on-demand computation, which is crucial for package management. Nix employs dynamic typing, allowing developers to express complex dependencies and transformations succinctly. Nix also supports string interpolation, making it easy to compose strings with variables and expressions, and the language provides a convenient way to access files and directories using lookup paths.
Unlike Bash, which relies on imperative scripting, Nix focuses on declarative specifications. Nix expressions are more concise and less error-prone. The functional nature of Nix aligns with languages like Haskell and Lisp, although its primary purpose is package management rather than general-purpose programming.
In its design, Nix drew inspiration from functional programming principles, with the goal of providing a consistent, declarative way to define and manage software packages. Nix also aims to create reproducible builds by capturing all dependencies and their versions explicitly, ensuring that the same package can be built consistently across different environments. Nix isolates packages from each other, preventing conflicts. Each package resides in its own directory, identified by a cryptographic hash.
Nix is widely used for system configuration management. NixOS, a Linux distribution built around Nix, allows users to declaratively define their entire system configuration. Nix simplifies package management by providing a consistent interface across different platforms, allowing developers to create and share packages easily. With Nix, developers can create isolated development environments with specific dependencies that can be shared across teams.
The Nix project was initiated by Eelco Dolstra, who played a significant role in shaping the language's design. A community of contributors, maintainers, and users actively improve the language and ecosystem.
The Nix programming language stands out for its functional, declarative approach to package management. Its influence on system configuration, reproducibility, and isolation make it a valuable tool for developers and system administrators.
This portion of our guide to computer programming languages highlights the Nix programming language, although topics related to the Nix package manager and NixOS may be listed here as well since they are interconnected. Websites focused on the language or any IDEs, editors, compilers, or other tools and utilities designed to facilitate the use of the Nix programming language are appropriate for this category, as are Nix community websites or forums, tutorials, reviews, or other content related to the language.
 
 
Recommended Resources
This is the official GitHub repository for Nix, a purely functional package manager for Linux and other Unix systems that. makes package management reliable and reproducible. Included here are the source code, documentation, and development resources, released under the LGPL v2.1 license. Issues and pull requests may be viewed. The Nix programming language is distinct from the package manager, although the language is used within Nix expressions to define package specifications.
https://github.com/NixOS/nix
GitHub hosts repositories for software or program language development projects, such as NixOS, where code, files, and revision histories can be stored, and serve as a central hub for managing and organizing work related to the project, in which multiple collaborators can work together. The NixOS repository includes the Nix package manager, Nixpkgs (a collection of Nix packages and configurations for NixOS), other related packages, and the official documentation for Nix.
https://github.com/NixOS/
Hosted on GitHub, this is a guide to the Nix operating system and the declarative Nix expression language, as well as a guide to setting up a NixOS desktop with all of the essential applications, tools, and games. The guide may be viewed here, in a web browser, or converted to a markdown file to a PDF in VSCode using an included extension Markdown PDF. The guide is sorted into chapters and sub-chapters that include setup information, obtaining the necessary software, and gaming.
https://github.com/mikeroyal/NixOS-Guide
Nix and NixOS are developed and used by a diverse and welcoming community, and the NixOS Foundation promotes participation without regard for gender, sexual orientation, disability, ethnicity, age, or other characteristics. Resources for the Nix development community include the official Community forum, where discussions, announcements, events, and job offers take place, as well as real-time chat help, developer chat, off-topic discussion take place, and other platforms.
https://nixos.org/community/
Presented on the official Nix development website, the basics of the Nix programming language are discussed here. Notable uses of the Nix language include NixOS, a Linux distribution that can be configured fully declaratively, and is based on Nix and Nixpkgs, as well as Nixpkgs, a large software distribution written in the Nix programming language. The Nix language has only a few basic concepts that will be introduced in this tutorial, and which can be combined arbitrarily.
https://nix.dev/tutorials/nix-language.html
This is the official manual for the Nix programming language, which was designed for conveniently creating and composing derivations, or precise descriptions of how contents of existing files are used to derive new files. In short, it is domain-specific, declarative, pure, functional, lazy, and dynamically typed. An overview of the language is provided, by example. An introduction, quick start, and installation instructions are provided, along with more advanced topics.
https://nixos.org/manual/nix/stable/language/
This is a platform dedicated to Nix-based projects and services. Included is an interactive guide that introduces the Nix programming language, focusing on language constructs and how Nix can be algorithmically used to solve problems, although it doesn't delve into specific Nix tools or the building and installation of software via stdenv.mkDerivation. Once loaded into a browser, Nixcloud can be used offline or online, and the source code for "A tour of Nix" is available on GitHub.
https://nixcloud.io/
The Nix Language for the Functionally Lazy OO Programmer
Introduced on the Lambda-Bob platform, which hosts informative content related to Nix and other topics, this section of its site discusses the Nix programming language, which is designed to manage packages efficiently, handling multiple ecosystems simultaneously, as well as providing a declarative approach to package management. Included is an overview of the Nix programming language, with insights into its capabilities, and tutorials on setting up programming environments in Nix.
https://lambdablob.com/posts/nix-language-primer/
Created by Determinate Systems, Zero to Nix is an opinionated learning resource for Nix. It provides help in navigating existing Nix documentation, which some beginners find difficult, and provides a guide to learning Nix and understanding its ecosystem. Among the aspects covered are the core Nix components, which include the Nix package manager, the Nix programming language, NixOS (a Linux distribution built on Nix), and Nixpkgs (a collection of Nix packages, libraries, and helper functions).
https://zero-to-nix.com/