This Month in Nix Docs - #2 - April 2023
This edition is a little late since last week I prepared to move to a new city 1300 miles away. As you can imagine that takes up a lot of time, but I’m back to Nix-ing and ready to present another month of progress on Nix documentation!
Community
The Documentation Team can be found in a number of places. Check the Documentation Team page and drop in if you’d like to contribute!
Google Season of Docs and Fundraising
Last month we submitted our application to Google Season of Docs with the hope that the funding would help us hire a paid editorial lead and a Nix expert that would help us develop a curriculum for how to most effectively onboard new Nix users. Unfortunately we were not chosen for Google Season of Docs. However, soon after we found out we were not chosen for Season of Docs, a fundraising effort was announced to try to raise the money that we applied for (full disclosure: this post is by @ron, my future boss at Flox, starting next week).
To date we’ve received >$17k, which is amazing! You can follow along with the progress or donate to the fundraising effort on OpenCollective.
With this money we’re looking to hire a few paid contributors for this project. If you know someone that’s an excellent teacher or has experience developing curricula, please direct them to the job description page!
Projects
Documentation rendering infrastructure
One of the tricky aspects of Nix documentation is that different projects have their own way of generating their documentation. For instance, the Nix Reference Manual is rendered with mdbook
, the NixOS Manual is rendered using nixos-render-docs
, and Nixpkgs uses this rendering pipeline:
-
Nixpkgs
lib
functions scraped to Markdown vianixdoc
-
Markdown to DocBook XML via pandoc and
nixos-render-docs
-
DocBook XML rendered to HTML via DocBook
Contributors @pennae and @asymmetric have been making progress on the rendering infrastructure to allow for more consistent rendering tooling across projects.
Replacing DocBook with Nixpkgs-flavored CommonMark necessitated writing our own rendering infrastructure (nixos-render-docs
)—no renderers existed that easily supported the entire feature set of Nixpkgs markdown, and while Pandoc came close it still used DocBook in the background to render to HTML and other targets. nixos-render-docs
is capable of rendering most of the Nixpkgs manual by itself, but still missing are output to ePub (which is needed for both the NixOS and the Nixpkgs manual) and many minor tweaks to nixos-render-docs
for features used in the Nixpkgs manual that aren’t used by NixOS. Help with these, especially the ePub export, is very much welcome. If you actually use this ePub output format we’d like to hear from you.
Learning Journey Working Group
The project I’m leading over at the Learning Journey WG is trying to figure out how exactly to teach Nix to a new user. I’m really happy with the discussions we’re having over there, and I would love it if you, dear reader, would join us. Your experience and how you learned Nix is valuable input for how we’re developing this curriculum.
The current idea is that we’ll have the user create a web server in Python that sits behind a proxy (e.g. Nginx) and talks to a database (e.g. Postgres). This will allow us to touch on a variety of topics such as:
-
Dropping into an ephemeral shell environment with
nix-shell -p
. -
Setting up a development shell with
shell.nix
-
Building a Python application in which the dependencies are specified with Nix
-
Running integration tests with NixOS VM tests
-
This puts the user in contact with NixOS configurations, the module system, etc
We haven’t actually written anything just yet, but it’s super important to understand the problem you’re working on before you jump into implementing anything. In the case of designing a curriculum the “problem” is answering questions like:
-
What is the correct sequence in which to introduce certain topics?
-
What is the correct “chunk size” in which to introduce new topics?
-
Nix can do all kinds of awesome, impressive stuff. How do we show that without introducing scope creep?
-
Do we keep the user on the happy path to reduce friction while learning something unfamiliar, or do we show them the hard stuff that they’re going to inevitably run into at some point?
-
Who is the audience we’re talking to? Is it Linux enthusiasts coming to Nix via NixOS? Is it people interested in reproducible builds? Is it people interested in bootstrapping development environments? How do we choose topics/paths that speak to all of these use cases?
These kinds of questions are why we’re looking to hire an expert teacher. I myself have multiple teaching awards from teaching during my physics PhD, but I’m far from what I would consider an expert. In the next month we’ll start sequencing and chunking this user journey so that we can identify how many steps the tutorial will be, in what order they’ll exist in, etc. As part of this process we’ll also be identifying where existing documentation has gaps for new users.
Documentation PRs Merged
NixOS/nix
-
#8220 Add commit-lockfile-summary to flake nixConfig whitelist (@accelbread)
-
#8201 Do not gate or hide experimental settings (@Ericson2314)
-
#8196 Mark experimental configuration settings programmatically (@Ericson2314)
-
#8174 Start cross-referencing experimental features (@Ericson2314)
-
#8167 glossary: Nix database (@fricklerhandwerk)
-
#8151 Mention internal API docs in PR template (@Ericson2314)
-
#8133 Extend internal API docs, part 2 (@Ericson2314)
-
#7887
nix derivation add
,show-derivation
→derivation show
(@Ericson2314) -
#7864 Use long options instead of short ones in the “quick start” (@Ericson2314)
-
#7798 Documentation: list experimental features in manual (@peeley)
NixOS/nix-pills
-
#211 Pill 13: Fix typo in repository derivation snippet (@mklntf)
-
#206 removing installation instructions (@henrik-ch)
NixOS/nix.dev
-
#520 Add recipes, reference, and contributing sections (@zmitchell)
-
#512 Fix typos in ad-hoc-developer-environments.md (@zmitchell)
-
#511 Add script for generating This Month in Nix Docs (@zmitchell)
-
#508 update Discourse name (@henrik-ch)
-
#504 add section on how to get help (@asymmetric)
-
#502 Add missing trailing newline in multi-line string example (@niklasmohrin)
-
#494 Add updated documentation survey (@zmitchell)
-
#491 NIX_PATH includes nixpkgs in cross-compilation.md (@Hamled)
-
#449 fixups to pinning overview (@fricklerhandwerk)
-
#425 add note on providing commit access to maintainers (@fricklerhandwerk)