Zero to Nix, an unofficial, opinionated, gentle introduction to Nix

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • devenv

    Fast, Declarative, Reproducible, and Composable Developer Environments

  • - Since nix "owns" the _entirety_ of the inputs and outputs to a piece of built software, shaping it into different artifacts becomes trivial. For example, as long as you're able to build a rust project with nix, nix easily lets you kick out a minimal OCI container (without needing to write a `Dockerfile`), or produce a tiny qemu clone of your system (or any system) by feeding your NixOS configuration into a function that produces images instead of configuring your running system.

    Hopefully that's helpful, sorry if it isn't - but nix is sort of alien software, and nix people are still learning how to best share its potential with others!

    [1]: https://devenv.sh/

  • nix

    Nix, the purely functional package manager

  • I'm not familiar with Environment Modules. I see they're popular in HPC?

    One difference: On Nix's homepage (https://nixos.org), the first word which stands out is "reproducible". -- If I search the read the docs for "reproducible", the word shows up once. https://modules.readthedocs.io/en/latest/index.html

    Not sure if there's anything recent, but links from this may be useful:

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Home Manager using Nix

    Manage a user environment using Nix [maintainer=@rycee]

  • Nix is pretty usable for both desktops and headless servers. Personally, I even use it on macOS without much trouble.

    My system looks like any other install of Ventura, but all of my configuration, ranging from the terminal and VS Code to macOS-specific system preferences and Safari, is done declaratively in Nix [1]. The overwhelming majority of my installed software also comes from Nix packages, with some exceptions for stuff that is not packaged yet (e.g., I have Podman Desktop, the macOS ZFS port, Lulu, yubikey-manager-qt installed through Homebrew -- fortunately nix-darwin [2] also just lets me have an set of brews/casks in my config).

    It was been a bit of a nightmare at first since the error messages are kind of horrific, and there can be a lack of good examples/docs on flakes. But I think the weekend worth of time I invested was worth it since I no longer need to rely on hacky shellscripts or remember to manually configure anything.

    [1]: <https://github.com/nix-community/home-manager>

    [2]: <https://github.com/LnL7/nix-darwin>

  • nixbyexample

    Learn nix by example

  • awesome-nix-hpc

    high performance computing related nix resources

  • nixpkgs

    Nix Packages collection & NixOS

  • Maybe `isLinux` is not the best example, as it's pretty much a self-documented boolean. But when I'm in the general situation you describe, I tend to just search github.com/NixOS/nixpkgs in order to figure out usage, if it's not documented elsewhere already.

    Here is an example for isLinux specifically: https://github.com/NixOS/nixpkgs/search?q=isLinux

    Reading through how the stdenv stuff is working might help as well, the generic lists a bunch of "is" booleans: https://github.com/NixOS/nixpkgs/blob/7e325cb89453651dbe9a17...

    In general I agree, things are vastly under-documented, and that makes it kind of hard, and only solution I've found is digging deeper into sources. Which had the happy side-effect of me understanding NixOS better as well.

  • nix-starter-configs

    Simple and documented config templates to help you get started with NixOS + home-manager + flakes. All the boilerplate you need!

  • https://github.com/Misterio77/nix-starter-configs is probably the closest to that right now.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • nix.dev

    Official documentation for getting things done with Nix.

  • nix-darwin

    nix modules for darwin

  • Nix is pretty usable for both desktops and headless servers. Personally, I even use it on macOS without much trouble.

    My system looks like any other install of Ventura, but all of my configuration, ranging from the terminal and VS Code to macOS-specific system preferences and Safari, is done declaratively in Nix [1]. The overwhelming majority of my installed software also comes from Nix packages, with some exceptions for stuff that is not packaged yet (e.g., I have Podman Desktop, the macOS ZFS port, Lulu, yubikey-manager-qt installed through Homebrew -- fortunately nix-darwin [2] also just lets me have an set of brews/casks in my config).

    It was been a bit of a nightmare at first since the error messages are kind of horrific, and there can be a lack of good examples/docs on flakes. But I think the weekend worth of time I invested was worth it since I no longer need to rely on hacky shellscripts or remember to manually configure anything.

    [1]: <https://github.com/nix-community/home-manager>

    [2]: <https://github.com/LnL7/nix-darwin>

  • nix-user-chroot

    Install & Run nix without root permissions [maintainer=@Mic92]

  • > There are workarounds but none of them official.

    But does it need to be official? Wouldn't that at the same time bloat nix even more? Isn't it enough if core people of the community for example build https://github.com/nix-community/nix-user-chroot ?

    > In reality the only easy way to get it done is to use additional non-foss software

    That is not true at all. You can use a nix docker image, a 5 line nix file and 2 commands to do a very basic CI pipeline almost anywhere.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts