- Nix never uses host dependencies, it always builds with exactly precise dependencies every time, and will always refer to them from then on.
- Nix lets you roll back changes atomically.
- nix-shell lets you make build environments that are totally reproducible across machines, and don’t interfere with each other. You can freely mix any number of libraries of versions or software on the same machine and they don’t conflict.
- With Ubuntu, every time you want to fix something with your car, you roll it into the garage, pop open the hood and get to work. It's intensive labour, results will vary, and undoing a change can be difficult.
- With NixOS, it's like 3D printing a new car every time. You'll design a model, press a button, and the car gets built from scratch. If you don't like it, tweak the design a bit, and print a new car. If the new car breaks, just go back to the previous known-good one, which is already in your garage. You can even take the design documents to your friend and generate an exactly identical model.
sudo
command sets the wrong$HOME
, have to usesudo -i
for nix commands that need sudo.- Nix is Turing complete language used for configuration and building packages.
- Can use nox, nix search, nix-repl, nixOS packages to search for packages.
- Think of Nix (the language) as an expression-based programming language where every program evaluates to a single (possibly complex) value; that resulting value is what is used as eg. the configuration of your system or a package, but it means that you can generate that value based on arbitrary logic and abstractions like you would with a regular programming language.
- As for domain-specific package managers, It Depends; it's possible with varying degrees of hackiness (and I definitely use eg. npm for development), but for a 'real' deployment - whether as a service on a server or as a local application - you'd want to convert your project's metadata to a Nix expression and let Nix handle the dependency management.
- Overlay adds/overrides something in the global package set.
- In general, you should only install things with nix, and not use any other package managers.
- The main idea of the Nix approach is to store software components in isolation from each other in a central component store, under path names that contain cryptographic hashes of all inputs involved in building the component, such as
/nix/store/rwmfbhb2znwp...-firefox1.0.4
. - Don't install libraries with Nix.
- Derivations are variables + build script.
- Docs are in
.xml
files in/docs
- To build derivation in nixpkgs, at root of
nixpkgs
, runnix build -f . <pkg-name>
(ienix build -f . wifi-password
) - To find out the SHA256, run
nix-prefetch-url -A <pkg-name>.src
(ienix-prefetch-url -A wifi-password.src
).nix-prefetch-url
works with GitHub. This gives you the SHA256 you can copy. - I think Nix's approach is the right way to build container images--build the image layers declaratively, reproducibly, incrementally (no, Dockerfile builds aren't incremental because dependency trees aren't linear), and without a container runtime dependency.
- Nix doesn't solve dependency resolution problems. Only pinning. There's ground to break there. Dependency management not being part of flakes is my biggest gripe with it. It would be our chance to be the once size fits all solution but we failed to deliver.
- There's a lot of unexplored potential of Nix in granular build systems and displacing systems like Bazel. If applied correctly, it lets smaller organisations get much of the benefit of Google-style monorepos but without as much maintenance overhead.
- Nix Manual
- Nix Pills (Code)
- Benefits of using nix
- Nix, the purely functional build system - Great intro article.
- A Gentle Introduction to the Nix Family
- Nix: A Reproducible Setup for Linux and macOS
- hnix - Haskell re-implementation of the Nix expression language.
- Haskell & Nix
- Brian McKenna - Nix for Functional Systems
- Learning Nix by Example: Building FFmpeg 4.0
- nix-shell and Shebang Lines
- Domen Kožar, Lead DevOps, Nix workshop
- Cheap Docker images with Nix
- When to use declarative approach and when not
- example-nix - A way to develop software with Nix.
- Hercules CI - Hosted CI for building Nix projects on your infrastructure.
- Dysnomia - Tool and plug-in system that can be used to automatically deploy mutable components.
- Disnix - Nix-based distributed service deployment tool.
- NUR - Nix User Repository: User contributed nix packages.
- Eris - Binary cache for Nix.
- pypi2nix - Generate Nix expressions for Python packages.
- hnix-store - Haskell implementation of the nix store API.
- nix-cheatsheet
- Nix RFCs
- nix-linter - Linter for the Nix expression language.
- Install Nix docs by Mozilla - Pretty good.
- Nix scripts shared across IOHK projects
- niv - Painless dependencies for Nix projects.
- Cachix - Build Nix packages once and share them for good.
- Alternative Haskell Infrastructure for Nixpkgs - Works by automatically translating your Cabal or Stack project and its dependencies into Nix code.
- nix-bundle - Bundle Nix derivations to run anywhere.
- crate2nix - Nix build file generator for rust crates. (Lobsters)
- lorri - nix-shell replacement for project development.
- Awesome Nix
- nixfmt - Formatter for Nix code.
- Nix for devs - Collection of recipes focused on nix-shell to make setting up project environments easy.
- nixpkgs-fmt - Nix code formatter for nixpkgs.
- Nix builder for Kubernetes
- Nixery - Provides the ability to pull ad-hoc container images from a Docker-compatible registry server. (Code) (Talk)
- Nixery: Improved Layering Design (2019)
- hnix-lsp - Language Server Protocol for Nix.
- Make Nix precisely emulate gitignore
- Nixery - Container registry which transparently builds images using the Nix package manager.
- wharfix - Minimal stateless+readonly docker registry based on nix expressions. Heavily inspired by Nixery.
- Nix - A One Pager - A (more or less) one page introduction to Nix, the language.
- yants - Tiny type-checker for data in Nix, written in Nix.
- nix-shorts - Collection of short notes about Nix, down to what is immediately needed for users.
- rnix-parser - Nix parser written in Rust.
- Naersk - Nix support for building cargo crates.
- nix-diff - Explain why two Nix derivations differ.
- Optimising Docker Layers for Better Caching with Nix (2018)
- nix-du - Visualise which gc-roots to delete to free some space in your nix store.
- NixCon 2019 - Main Track
- Nix flakes (2019)
- Nix: How and Why it Works (2019)
- Nix recipes for Haskellers
- format-nix - Simple formatter for Nix using tree-sitter-nix.
- go-nix - Nix language parser and Nix-compatible file hasher in Go.
- nix-dns - Nix DSL for DNS zone files.
- Nix-based app VMs
- nix-index - Quickly locate nix packages with specific files.
- Nix-bisect - Bisect Nix Builds.
- Thoughts on Nix (2020) (Lobsters)
- I was Wrong about Nix (2020) (HN) (Lobsters)
- Grafanix - Visualize your Nix dependencies.
- What's your configuration.nix like?
- Built with Nix - Build software only once. (Code)
- How I Start: Nix (2020) (Lobsters)
- rnix-lsp - WIP Language Server for Nix.
- Language server for Nix language
- Eelco Dolstra's talks/papers (Code)
- Nix Haskell Monorepo Tutorial
- The journey of packaging a .NET app on Nix (2020)
- nixpkgs - Nix Packages collection.
- Nix IRC logs
- Nixology (2020) - Series of videos I've been releasing within Shopify to help promote and educate about Nix.
- Nix function to easily create derivations (packages) to install binaries from location
- What Is Nix (2020) (HN) (Lobsters)
- What Is Nix and Why You Should Use It (2020)
- comma - Runs software without installing it. Wraps together nix run and nix-index.
- nix-derivation - Parse and render *.drv files.
- nix-build-uncached - CI friendly wrapper around nix-build.
- nix-tests - Scratchpad for small experimental things I am doing with Nix.
- Nix Flakes, Part 1: An introduction and tutorial (2020)
- Nix Flakes, Part 1: An introduction and tutorial (Lobsters) (Lobsters 2)
- nix-overlays of Antonio Monteiro
- A Nix terminology primer by a newcomer (2020)
- Statistical Rethinking and Nix (2020)
- flake-utils - Pure Nix flake utility functions.
- nix.dev - Opinionated guide for developers wanting to get things done using the Nix ecosystem. (Code)
- Nix language antipatterns
- So, tell me about Nix (2020)
- nixdu - Interactively browse the dependency graph of your Nix derivations.
- Nix Package Versions - Search for old versions of Nix packages. (Code) (Reddit)
- Opinionated Nix repository template - Based on nix.dev tutorials, repository template to get you started with Nix.
- Tools to manage a Nix-based project
- Building static Haskell binary with Nix on Linux (2020)
- Template for NUR repositories
- Bramble - Functional build system inspired by nix.
- The easiest way (I've found) to create your own Nix channel (2020)
- Nix Monorepo - How you might use Nix in a larger, multi-language project.
- A Tutorial Introduction to Nix (2020)
- nixbuild.net - Cloud service that runs your Nix builds. It takes away the effort of maintaining and scaling build clusters, and integrates easily with any setup that uses Nix. (Docs) (Tweet)
- Manix - Fast CLI documentation searcher for Nix.
- Review of home manager (2020) (Lobsters)
- Nix Quick Install Action - GitHub Action installs Nix in single-user mode, and adds almost no time at all to your workflow's running time. (Web)
- Setting up a Nix S3 binary cache (2020) (Lobsters)
- swift2nix: Run Swift inside Nix builds (2020)
- sorri - Simple, lightweight implementation of Tweag's lorri.
- Nix and the nix-shell for easily redistributable scripts (2020)
- nix-buildkite - Take a Nix job description and turn it into separate Buildkite steps with dependencies. (Tweet)
- pre-commit-hooks.nix - Seamless integration of pre-commit git hooks with Nix.
- Nix + Haskell setup
- caching your nix-shell (2020)
- nix-direnv - Fast, persistent use_nix implementation for direnv.
- NixCon 2020 (Stream) (Code) (HN)
- Nix UX improvements
- NixCon 2020 talk about Nix flakes
- Nickel - Lightweight configuration language. Its purpose is to automate the generation of static configuration files. (Nickel: better configuration for less)
- Nix-based process management framework
- Local Nix Cache - Poor and hacky attempt at re-serving local nix packages that came from trusted sources.
- Nix parallelism & Import From Derivation (2020) (Reddit)
- macOS Nix setup: an alternative to Homebrew (2020) (Lobsters) (HN)
- update-nix-fetchgit - Program to automatically update fetchgit values in Nix expressions.
- Cache install Nix packages - Use the GitHub Actions cache for Nix packages.
- nixbuild.net Action - GitHub Action for using the nixbuild.net service.
- fromElisp - Emacs Lisp reader in Nix.
- On-demand linked libraries for Nix (2020) (Lobsters)
- Towards a Content-Addressed Model for Nix (2020) (HN)
- deploy-rs - Simple, multi-profile Nix-flake deploy tool.
- TodoMVC-Nix - One-stop reference to build TodoMVC application inside the Nix world.
- Trustix: Distributed trust and reproducibility tracking for binary caches (2020) (Code)
- Binary Verification with Trustix starring Adam Höse (2021)
- Building with Nix Flakes for, eh .. reasons (2021)
- What is the right approach to handling binary, non-executable data dependencies of packages? (2021)
- Scrive Nix Workshop (Code)
- nix-npm-buildpackage - Build nix packages that use npm/yarn.
- dev-env - Nix with training wheels.
- Basinix - Pull request reviewing tool for nixpkgs.
- Nix-template - Make creating nix expressions easy. Provide a nice way to create largely boilerplate nix-expressions.
- nixpkgs-hammering - Set of nit-picky rules that aim to point out and explain common mistakes in nixpkgs package pull requests.
- nix-script - Write scripts in compiled languages that run in the nix ecosystem, with no separate build step. (Article)
- nix-update - Updates versions/source hashes of nix packages. It is designed to work with nixpkgs but also other package sets.
- Nix Portable - Static, Permissionless, Installation-free, Pre-configured.
- nix-optics - Using profunctor optics to focus modifications in Nix.
- Use Nix flakes without any fluff
- Nix-environments - Repository to maintain out-of-tree shell.nix files.
- Determinate Systems - Nix ecosystem consulting by Graham Christensen.
- How to Learn Nix
- Nix is the ultimate DevOps toolkit (2021) (HN) (Lobsters)
- devshell - Per project developer environments.
- Nix Data - Set of packages for data-scientists with batteries-included.
- Nomia - System for precise, efficient resource management across every domain and resource type.
- Chimera - Nix-based package manager with the focus on developer experience.
- Data Science with Nix: Parameter Sweeps (2021)
- Nixpkgs rules for Bazel - Rules for importing Nixpkgs packages into Bazel.
- Practical Nix Flakes (2021)
- npmlock2nix - Utilizing npm lockfiles to create Nix expressions for NPM based projects.
- Laurn - Run a dev-environment in a pure-ish nix environment.
- nix-filter - Small self-container source filtering lib.
- nix-eval-lsp - Nix language server that evaluates code.
- Flakes are such an obviously good thing: ...but the design and development process should be better (2021) (Lobsters)
- scratchix - Linux From Scratch, but it's Nix.
- Understanding Nix's String Context (2018)
- Replit now supports every programming language in Nix (2021) (HN)
- nix-graph - Reify the Nix build graph into a Haskell graph data structure.
- Digga - Feature rich and configurable framework for harnessing Nix Flakes.
- Nix solves the package manager ejection problem (2021) (HN)
- Cross compilation using Nix
- nix-std - no-nixpkgs standard library for the nix expression language.
- Nix unstable installer - Place to host Nix unstable releases.
- Nix Learning - Links to blog posts, articles, videos, etc for learning Nix.
- nix-plugins - Collection of useful Nix native plugins.
- Nix.Ci - Provides the CI integration infrastructure for Nixpkgs and NixOS. More commonly known as OfBorg. (Code)
- nix-user-chroot - Install & Run nix without root permissions.
- Another Nix Success Story (2021) (Lobsters)
- nix bundle - Bundle an application so that it works outside of the Nix store.
- Building Container Images with Nix (2021) (HN)
- Debug symbols for binaries with Nix (2021)