How to Learn Nix

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

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

    Nix, the purely functional package manager

  • > - Examples that just don't work.

    yes, the nixpkgs changes and some old articles might no longer be accurate :/

    > - Commands that run and no output is given, even though the text I'm following says it should output information I need.

    could you give an example?

    > - Do I need nix-darwin? Well, the readme explains what it is: "Nix modules for darwin, /etc/nixos/configuration.nix for macOS." What? (Finally I found an answer at Stack overflow, and it seems I don't need it. Seems to be kind of NixOS on top of macOS)

    yes, you don't need it for what you described. nix-darwin is basically to provide configuration functionality of NixOS to your Mac. Nix-darwin is 3rd party product that's written in Nix for Nix. Similarly Home Manager.

    > - Can't build with nix-build. After long time searching it seems like you're supposed to run nix-build -E 'with import {}; callPackage ./default.nix {}' - shouldn't there be a simpler way for this common case?

    a lot of people wrote about it. This is a convention that evolved from nixpkgs, it's still not officially supported by CLI tool (that's why the command looks so complicated, it's similar to calling `python -c "`), seems like the default.nix file which is very similar in concept to setup.py (as you can put whatever you want inside) is being replaced by more stricter flakes.nix file. Which in a way brings some similarities to the callPackage convention.

    > - An issue open since 2018 that the manuals simple example doesn't build: https://github.com/NixOS/nix/issues/2259 People chiming in years later that they only could build the example after reading the suggestions in that issue.

    Because software evolves and old versions of file like to disappear with time. I run into this as well, although it was nix pills documentation. My solution was to simply get the new version of hello and use that. Although I agree, that's still unnecessarily confusing. I think a proper solution would be to host the file on the own server. So this won't happen anymore.

    > - And now I can't start my nix-shell because it says there's a problem with SSL certificates. I'm giving up.

    You most likely uninstalled nss-cacert package. Perhaps `nix-env --rollback` would help.

  • dotfiles

  • I'm using nixos for years, still couldn't grasp the language itself enough. I accepted that it's not for us, who are not familiar with functional programming. Like, what is even this: https://github.com/Ryunaq/dotfiles/blob/b132f79e2042d6ef7500...

  • 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
  • valhalla

    Open Source Routing Engine for OpenStreetMap

  • Love the idea of a blog post like this. I tried something very similar a couple weeks ago on a c++ project, both in hopes it might lead to an improved user experience, and also for others struggling to figure it out.

    https://github.com/valhalla/valhalla/discussions/3540

  • nixpkgs

    Nix Packages collection & NixOS

  • You might want to read "Nix Pills" if you ever want to look into Nix again. It's the best introductory material for Nix that I'm aware of, and it gave me a better picture of the basics required to get comfortable with Nix.

    It's on the NixOS website, but IMO it's worth making it more visible to newcomers:

    https://nixos.org/guides/nix-pills/

    From my experience, it became considerably more easier to figure out or search for solutions once I've grasped the basics from "Nix Pills." Once I became comfortable enough, I relied heavily on the Nixpkgs repository[1] as a great source of information. It has an approachable codebase and some quick grepping gave me many examples when trying to figure out how to write packages for a particular language.

    [1]: https://github.com/NixOS/nixpkgs

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