Nix Istanbul session

learning

#1

During the Istanbul offsite, I’ll be doing a presentation about Nix and how we use it in the status-react repo. I would like to get your suggestions on format/content. Here’s an initial draft to seed the discussion:

  • Quick explainer of the Nix language;
  • Building a simple development environment with Nix;
  • Walkthrough of some areas of our status-react Nix setup;
  • Q&A.

The initial time slot allocated for the session is 30 minutes, but I imagine we can change that default to 1 hour depending on the interest and number of questions you’ll be bringing (highly recommended as we don’t have that many face-to-face opportunities to transmit knowledge about complex subjects).


#2

This is a great idea, and I’m looking forward to seeing your presentation.

I think it’s more important to explain how Nix works and how to use it, rather than the intricate details of its setup in status-react repo, which is very complex.
In my opinion it would make most sense to:

  1. Show some examples of Nix syntax (without any derivations)
  2. Show using simple Nix expressions in practice using nix-instantiate --strict --json --eval
  3. Introduce mkShell and how it can create a controlled shell environment
  4. Show mkShell in practice using nix-shell
  5. Introduce mkDerivation on a practical example package simpler than status-react
  6. Show it’s usage with nix-build and what are its results
  7. Introduce /nix/store and it’s structure
  8. Go more in-depth by showing usage of nix-instantiate with nix-build

Not sure if this can be fit in 1 hour, but that’s how I’d like to see it done if I was to forget all I know about Nix and had to re-learn it. Only after having this foundation would showing examples from status-react be useful to someone previously unfamiliar with Nix.


#3

looking forward to this. Been playing with nixOS on an old laptop so this will be quite helpful.