Intersect Committees
Intersect Knowledge BaseIntersect Website
Intersect - Open Source Committee
Intersect - Open Source Committee
  • ABOUT
    • Open Source Committee (OSC)
      • 🙂Open Source Committee Charter
      • Committee Members
      • Open Source Committee 2025 Proposals
      • OSC Communications
      • OSC Engagement
      • How to Join or Contact Us?
    • 🤠Open Source Office (OSO)
      • 😛2025 OSO Roadmap
        • 😍2024 OSO Roadmap (Archive)
      • 😲Developer Advocate Program
        • State of Developer Experience Survey
        • Developer Advocate Cohort #1
      • 😎Strategic Partnerships
        • 🧑‍🏫TODO Group
        • 🏗️Linux Foundation Decentralized Trust (LFDT, prevousliy Hyperledger)
        • 🦉Bitergia Analytics
      • 👨‍🏫Project Support Services
      • 📊Cardano’s Decentralized Shift: Key Players and Impact
      • 📈Current Monthly Maturity Report
      • 😉True Open Source Maturity Pilot
      • 📜Intersecting Open Source and Sustainability: A Paid Open Source Model for Ecosystems
    • 🤩Open Source Strategy
  • 📚Guides and Educational Resources
    • 🚶‍♂️Hitchhiker's Guide to Cardano
    • 🤯Onboarding Guide for Haskell Learners
    • 🎓Functional Programming in Haskell
    • 🧑‍🎓Advanced Functional Programming in Haskell
    • 😁Onboarding Guide for Rust Learners
    • 😉Onboarding Guide for Aiken Learners
    • 😅Onboarding Guide for Nix Learners
  • Working Groups
    • Developer Experience Working Group
    • Commercialization Working Group
      • SWOT Analysis
    • OSC Working Group Archive
      • Project Incubation WG (Archive)
      • Open Source Libraries Working Group
  • Policies
    • Introduction
    • 📜Governance Policy
      • Documentation
      • Legal
      • Glossary
    • 🔐Security Policy
    • 🪜Contribution Ladder Framework
    • 😋Project Incubation Lifecycle Framework
      • 🥹Project Incubation: Acceptance Criteria
    • ✅OSC Voting Policy
      • OSC Off-Cycle Vote 09.2024
  • OSC Meeting Minutes
    • Open Source Committee Meeting Minutes
      • 2024 Meeting Minutes
        • 😁(12/15/23) Meeting Minutes
        • 😆(01/12/24) Meeting Minutes
        • 😊(01/26/24) Meeting Minutes
        • 😉(02/02/24) Meeting Minutes
        • 😎(02/16/24) Meeting Minutes
        • 🥹(02/23/24) Meeting Minutes
        • 😍(03/01/2024) Meeting Minutes
        • 🫠(03/08/2024) Meeting Minutes
        • 🥹(03/15/2024) Meeting Minutes
        • 😅(03/22/2024) Meeting Minutes
        • 😆(03/28/2024) Meeting Minutes
        • 😁(04/12/2024) Meeting Minutes
        • 😛(04/19/2024) Meeting Minutes
        • 🤓(04/26/2024) Meeting Minutes
        • 🥸(05/03/2024) Meeting Minute
        • 😏(05/17/2024) Meeting Minutes
        • 🫨(06/07/2024) Meeting Minutes
        • 🤩(06/21/2024) Meeting Minutes
        • 😌(07/12/2024) Meeting Minutes
        • 😎(07/19/2024) Meeting Minutes
        • 🤐(08/02/2024) Meeting Minutes
        • 🙃(08/08/2024) Meeting Minutes
        • 🤠(08/22/2024) Meeting Minutes
        • 😵(09/05/2024) Meeting Minutes
        • 🧔(09/20/2024) Meeting Minutes
        • 👋(10/03/2024) Meeting Minutes
        • 🙃(10/31/2024) Meeting Minutes
        • 🤤(11/07/2024) Meeting Minutes
        • 😛(11/14/2024) Meeting Minutes
        • 😅(12/12/2024) Meeting Minutes
        • 😉(12/19/2024) Meeting Minutes
      • 🙂(01/09/2025) Meeting Minutes
      • 😉(01/16/2025) Meeting Minutes
      • 🙂(01/23/2025) Meeting Minutes
      • 😉(02/06/2025) Meeting Minutes
      • 🤓(02/20/2025) Meeting Minutes
      • 😆(03/06/2025) Meeting Minutes
      • 🙃(03/20/2025) Meeting Minutes
      • 🫢(04/03/2025) Meeting Minutes
      • 😅(04/17/2025) Meeting Minutes
      • 🙃(05/01/2025) Meeting Minutes
      • 🤭(05/15/2025) Meeting Minutes
      • 😛(05/29/2025) Meeting Minutes
      • 🥳(06/12/2025) Meeting Minutes
  • All Monthly Reports
    • Bitergia Repo Maturity Reports
      • Monthly Maturity Reports - 2025
        • Monthly Maturity Report - January 2025
        • Monthly Maturity Report - February 2025
        • Monthly Maturity Report - March 2025
        • Monthly Maturity Report - April 2025
        • Monthly Maturity Report- May 2025
      • Monthly Maturity Reports - 2024
        • Monthly Maturity Report - May 2024
        • Monthly Maturity Report - June 2024
        • Monthly Maturity Report - July 2024
        • Monthly Maturity Report - August 2024
        • Monthly Maturity Report - September 2024
        • Monthly Maturity Report - October 2024
        • Monthly Maturity Report - November 2024
        • Monthly Maturity Report - December 2024
Powered by GitBook
On this page
  • Why Learn Nix?
  • Who This Guide Is For
  • Getting Started
  • First Steps
  • Learning Resources
  • Tooling and Development Environment
  • Community and Support
  • Suggested First Projects
  1. Guides and Educational Resources

Onboarding Guide for Nix Learners

This page is in active construction and welcome to feedback for any inaccuracies.

PreviousOnboarding Guide for Aiken LearnersNextDeveloper Experience Working Group

Last updated 1 day ago

Why Learn Nix?

Nix is a novel, functional package manager and build tool focused on reproducibility and isolation. By design, Nix builds each package in a sandbox with explicit dependencies, so “if a package works on one machine, it will also work on another” . In practice this means you can define your entire development or deployment environment in plain-text Nix files and rebuild it exactly, byte-for-byte, on any Linux or macOS machine . For example, one user notes that “Nix lets me have multiple projects on the same system that each have their own independent view of what dependencies are available” – you can run an old Python 2.7 project and a new Python 3 project side-by-side without conflict. Nix also ensures atomic upgrades and rollbacks: installing or updating a package never overwrites others, and you can instantly roll back if something breaks . In short, Nix eliminates “it works on my machine” issues by making your environment declarative (all tools and versions are described in code) and reproducible .

Who This Guide Is For

This guide is for developers and contributors eager to use Nix for reproducible builds and environments. You might be a programmer learning Nix for the first time, a data scientist who needs consistent tool versions, or an open-source maintainer seeking declarative deployment. No prior Nix experience is assumed – if you know basic Unix command-line usage and care about reproducibility, you’re the right audience. (Nix works on Linux and macOS, and can even be used in Windows via WSL2.) Ultimately, anyone who wants reliable, shareable development environments – from students to DevOps engineers – will benefit from Nix.

Getting Started

The easiest way to install Nix is via the official installer script. On Linux (with systemd), run the multi-user installer as root or with sudo:

bashCopyEdit$ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon

This creates /nix/store and adds the nix command to your shell profile . On macOS, the same script works (without --daemon by default); open Terminal and run:

bashCopyEdit$ sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)

Then restart your shell or source the profile to get nix in your PATH . On Windows, install Nix inside WSL2 with systemd enabled: enable systemd (per Microsoft’s guide) and run the installer (with --daemon if desired) . After installation, you can verify by running nix --version or nix-env --version.

Optional configuration: To use Nix’s new “flakes” feature for reproducible projects, you’ll need to enable it in your Nix config. For example, add this line to ~/.config/nix/nix.conf:

iniCopyEditexperimental-features = nix-command flakes

or always run Nix with --experimental-features 'nix-command flakes'. This lets you use commands like nix flake init and nix develop (covered below).

Tip: Read the Nix manual’s Quick Start or the NixOS manual for more details. The Nix download page provides the same instructions and links to the official docs .

First Steps

Once Nix is installed, try out its core commands and features:

  • Home Manager (per-user config): Home Manager is a Nix-based tool to manage your home directory (dotfiles, user services, personal packages) declaratively. After installing Nix, you can add the Home Manager channel and install it, then write a home.nix file describing your setup. For example, you might include home.packages = [ pkgs.tmux pkgs.vim ]; and enable programs.zsh.enable = true. Running home-manager switch will apply your config. In fact, Home Manager “provides a radically better way to manage a user’s environment for both packages and dotfiles, effectively allowing you to take a configuration-as-code approach”ghedam.at. (It works on any Linux or macOS system with Nixghedam.at.) See the Home Manager manual or tutorials for step-by-step installation.

Learning Resources

There are many high-quality, beginner-friendly resources for Nix:

  • Video and interactive: YouTube has talks and tutorials from NixCon and community members (e.g. “Nix for Beginners” playlists). The NixOS Wiki lists community-curated channels (see Nix Channels). For hands-on practice, sites like NixOS Playgrounds or Replit CoCalc let you run Nix examples in a browser.

  • Package search: The Nixpkgs search or NixOS Packages Search is invaluable for finding Nix package names. The NixOS weekly newsletter summarizes latest news and blog posts.

Wherever possible, prefer official or well-maintained sources. The NixOS wiki and Discourse forums also maintain FAQs and tutorials. Try a few of these resources to find the explanations that suit you, and keep them handy as you learn.

Tooling and Development Environment

Nix integrates with many developer tools and editors:

  • Other editors: Emacs users can use nix-emacs or use-package integrations to load environment automatically. Vim/Neovim users can rely on vim-dispatch with nix-shell. In general, any editor that launches a shell (e.g. for language servers) can benefit from a Nix shell environment. Many language LSP servers (Haskell, Rust, Python) work out-of-the-box once the tools are in the Nix shell.

  • Build tools: You can use Nix with CI/CD as well. For example, GitHub Actions or NixOS GitLab CI templates show how to build Nix projects in pipelines. For containerized apps, Nix can produce Docker images deterministically.

Overall, the goal is to make Nix your ambient environment: code editors and terminals automatically use the Nix-defined versions of compilers, linters, etc., so you’re always running the right toolchain.

Community and Support

Nix has an active, helpful community. Key places to get help:

  • Reddit: The subreddits /r/NixOS and /r/Nix have many users sharing tips and news. (Reddit is unofficial but often quick for beginner questions.)

  • GitHub: Many Nix projects are on GitHub: in particular the Nixpkgs repo and the Nix repository itself. Browse their issue trackers or Discussions pages to see ongoing work and ask development-level questions. Reporting bugs or contributing fixes on GitHub is welcome once you’re more advanced.

  • StackOverflow: The nix tag on StackOverflow has Q&A for common problems, though coverage is spotty. For quick issues, Discourse or Matrix is usually faster.

  • Weekly newsletter and blog: Keep an eye on the NixOS Weekly newsletter and the Nix blog for announcements, tutorials, and community news.

When asking questions, include relevant details (Nix version, system) and any Nix expressions you’re using. The community is generally very helpful to newcomers.

Suggested First Projects

Hands-on practice will cement your Nix skills. Here are some ideas for starter projects:

  1. Reproduce a developer environment: Pick a simple project in a language you know (e.g. a small Python or Node.js app). Write a shell.nix (or flake.nix) that provides the right compiler/interpreter and libraries. For example, make a Python shell.nix that loads Python 3 and numpy/matplotlib, then verify you can run your script. This shows off isolated, reproducible envs.

  2. Package a command-line tool: Find a small open-source project (say, hello.c) and write a default.nix that builds it. You’ll learn how to use stdenv.mkDerivation or (easier) how to call pkgs.makeShell/pkgs.runCommand in a flake. Build it with nix-build and run the result in ./result/bin/hello. Consider contributing it to Nixpkgs if it’s missing.

  3. Manage dotfiles with Home Manager: Install Home Manager and move one of your config files (e.g. for git or your shell) under Nix management. Declare it in home.nix and run home-manager switch. This gets you familiar with Nix expressions for user config.

  4. Use Nix in a CI or Docker: If you have a GitHub repo, try adding a GitHub Actions step that runs a Nix build. Or use Nix to create a Docker container: e.g. nix-build '<nixpkgs/nixpkgs>' -A dockerTools.buildImage with a simple NixOS config. This shows off Nix’s declarative deployment.

  5. Explore NixOS (optional): If you’re adventurous, try the NixOS live ISO in a VM. It’s a full Linux distro entirely configured in Nix. Even if you stick to using Nix on another distro, seeing a system configured by Nix can deepen your understanding.

As you try these projects, consult the resources above when you get stuck. The key is to start small and expand: every time you tweak shell.nix or add a package to nix-env and see it build, you’ll learn something new. Welcome to the Nix ecosystem – enjoy the journey to reproducible, declarative environments!

nix-shell (ad-hoc development shells): Run nix-shell -p pkg1 pkg2 … to drop into a temporary shell where those packages are available. For example nix-shell -p hello git starts a shell with hello and git installed. This is great for trying tools without installing them system-wide. For more complex cases, you can write a shell expression in a file (e.g. shell.nix) to declare your environment, and then just run nix-shell. See the Nix tutorials for how to write shell.nix (for example, using mkShell or mkShellNoCC) to set up projects with all needed tools.

nix-env (per-user profiles): You can install packages into your personal Nix profile. For instance, nix-env -iA nixpkgs.hello installs the hello package (via the Nixpkgs collection). Use nix-env -qaP <pattern> to search for packages. Newer Nix versions also have nix profile install (e.g. nix profile install nixpkgs.hello) which achieves the same in a more modern way. Your installed packages live in ~/.nix-profile. To upgrade, run nix-env --upgrade (or nix profile upgrade). Since Nix keeps old versions, you can always roll back by nix-env --rollback if something goes wrong.

Flakes (project pinning): Flakes are an optional Nix feature for reproducible projects. A flake is a directory (often a Git repo) containing a flake.nix and flake.lock. You can create one with nix flake init -t or manually. A flake can define outputs like devShells, packages, or NixOS configurations. For example, a simple flake.nix might declare devShells.default = mkShell { packages = [ pkgs.python39 pkgs.numpy ]; }. Then running nix develop (or nix shell .#default) will load that environment. Because flakes use a lock file, all dependencies (even the Nixpkgs version) are pinned, ensuring reproducibility. Flakes are still marked experimental in some Nix releases, but they offer a clean way to share Nix setups with others .

Each of these tools builds on the same core idea: write down what you need in Nix language, and Nix takes care of fetching/building and isolating it. As one Nix user notes, even beginners can have fully Nix-managed dev environments in about 20 minutes . In the next section we’ll list many learning resources to deepen your understanding.

Official documentation and tutorials: The NixOS website hosts guides and references. For example, “How Nix Works” explains the core principles . The Nix Pills tutorial series is a classic introduction on nixos.org . The NixOS/Nix manual pages cover commands like nix-shell and Nix expressions. The nix.dev site (community-driven) has guided tutorials (e.g. setting up shell.nix) and a full reference.

Books and guides: NixOS & Flakes Book (free online) is an unofficial beginner book covering Nix and NixOS with examples . (Its preface even invites beginners: “Looking for a beginner-friendly tutorial? Then you've come to the right place!” .) Other recommended reads include Nix Pills (as above) and Nix Cookbook (paid). For advanced learning, Learning Nix by Fumito Kowasaki (free) and various blog posts can help.

Tutorials and blogs: Many community blogs and articles walk through Nix basics. For example, Michael Lynch’s blog shows how to set up per-project environments . The blog “Reproducible Data Science with Nix” by B. Rodrigues (July 2023) has a gentle intro to using Nix for R and data projects . The official Tweag blog has a “Flakes” tutorial by Nix founder Eelco Dolstra . Searching for “Nix tutorial” or “Nix pills” will turn up more guides.

VS Code: There’s a Nix Environment Selector extension that can automatically switch your VSCode workspace to use a Nix shell . You can also use the direnv extension with nix-direnv to auto-load the shell for each project. The NixOS Wiki notes that you can use nix-direnv with the VSCode direnv extension, or the nix-env-selector extension for manual switching . If you use VSCode on NixOS, you can install vscode.fhs or use the flatpak-based /Applications with a proper NIXPATH.

Direnv and Lorri: For any shell or editor, the direnv tool works well with Nix. You can drop a .envrc in your project with use nix or use flake, and direnv will auto-load the environment. Lorri is another tool that watches your shell.nix and rebuilds it when it changes, feeding updates to direnv in the background. As described on its homepage, “lorri is a nix-shell replacement for project development” with fast direnv integration . After enabling lorri and direnv in your config, simply run lorri init in a project; from then on it will keep your dev environment in sync without blocking your terminal .

Discourse (NixOS Forum): The official NixOS Discourse forums (discourse.nixos.org) are the central Q&A site. Ask questions, browse tutorials, or read the wiki. The NixOS website explicitly points new users to the forum for “Get in Touch” .

Matrix Chat: The Nix community has Matrix (chat) rooms, e.g. #nix and #nixos on Matrix.org (accessible via matrix.to). You can ask questions in real time there. The NixOS site lists “Matrix Chat” as a primary contact option .

📚
😅
nixos.org
nixos.org
brodrigues.co
mtlynch.io
nixos.org
nixos.org
brodrigues.co
nixos.org
nixos.org
nixos.org
tweag.io
nixos.org
nixos.org
nix.dev
nix.dev
nixos.org
tweag.io
mtlynch.io
nixos.org
nixos.org
nixos.org
nixos-and-flakes.thiscute.world
nixos-and-flakes.thiscute.world
mtlynch.io
brodrigues.co
brodrigues.co
tweag.io
nixos.wiki
nixos.wiki
github.com
github.com
nixos.org
nixos.org