2023-04-06 - Learning Journey Working Group - Meeting Notes #3
Previous meeting notes: 2023-03-30 - Learning Journey Working Group - Meeting Notes #2
- Attendees: @infinisil @zmitchell @erooke @henrik-ch @khaled @k7 (later: @fricklerhandwerk)
- Notes taken by: @infinisil
Previous action items
-
Brian opened Tracking issue - re-shape current content into a structure based on Diataxis · Issue #499 · NixOS/nix.dev · GitHub
- @zmitchell: Should have new headers for the four diataxis categories. First should be tutorials with first steps in order
- @infinisil and @erooke: Radicale docs work like that and are useful
- @henrik-ch: Radicale also has top-level Contribute header
-
@zmitchell: Have a list of desired issues, one big issue with everything or all in separate issues.
- I have a PR for an issue template related to this
-
@zmitchell: Last time we discussed having a tutorial for
nix-shell -p
, turns out there’s a tutorial for this on nix.dev already: Ad hoc shell environments — nix.dev documentation- Should we make changes without user studies, especially for content that already went through user studies?
- Probably shouldn’t hesitate to make obvious improvements.
- Worries that user studies are a high bar. We’d need some dedicated process to get that to work smoothly.
- A light-weight process for smaller changes should be okay.
- @khaled: Only do user-studies for larger changes or filling out gaps. Not necessary for smaller changes
-
@zmitchell: Should probably be discussed with the entire docs team
- @fricklerhandwerk: No objections. Have to balance effort and payoff.
Next tutorial
-
@zmitchell: What should the next tutorial be? Turning an ephemeral shell into a declarative one in a
shell.nix
. Make it a continuation of the first tutorial, make some changes to have them be more aligned, use the same packages in the environment-
@infinisil: That sounds like Declarative shell environments with shell.nix — nix.dev documentation
-
@zmitchell: Not sure if pinning should be a requirement
-
@fricklerhandwerk: Hard dependency is Nix language basics — nix.dev documentation, but pinning also, maybe with
niv
- effectively finding Nixpkgs hashes so far is not described anywhere really
-
@henrik-ch: Tutorial flow makes sense from top to bottom
-
@zmitchell: I don’t think the Nix language should be a strict requirement. E.g. just go to Nixpkgs and grab this identifier, add it to the
packages
list inmkShell
. The requirement should be as minimal as possible -
- Onboarding story:
- Show
nix-shell -p
, possibly shebang - Immediate next question is how to persist it, but then comes Python, Node, and more complicated things
- Should show pinning (e.g. niv) and direnv, but then leads to home-manager, etc.
- Reading the Nix language comes quickly, and preexisting programming language knowledge doesn’t help much
- People are quickly confused by the need for parenthesis, semicolons, etc.
- Show
-
@zmitchell: Nix language basics — nix.dev documentation goes into details not necessary for the declarative shell. We can show the user a basic
shell.nix
and highlight parts of it, explaining what is input, output, key-value set, function body, etc. Beginners and experts see the same thing differently.- @khaled: Agreeing. But then continue with expansion on why this is not good enough. Add nixpkgs reproducibility, why we want it, step-by-step.
-
@zmitchell: direnv and home-manager shouldn’t be necessary here
- @henrik-ch: Agreeing
- @khaled: Agreeing. Do it more step-by-step, e.g. why you might not want to install it imperatively
-
@erooke: Python works with its own environments
- @fricklerhandwerk: Later fan-out into what you can all pin more deterministically using Nix
- @khaled: Npm also works unless you try to do global installments
- Onboarding story:
-
@fricklerhandwerk: the example should not even be a function, it raises lots of questions:
- @infinisil: system argument is needed for flakes but only later. Sounds alright to not have a function for now
- @zmitchell: Minimal?
- @fricklerhandwerk: Start out without pinning, only introduce it later. Flakes would solve this but it adds a lot on top. Should first understand how Nix works
-
@infinisil: First step is just about putting the command into a file, and
<nixpkgs>
is also whatnix-shell -p
uses, only the next step should be making it reproducible - @khaled: Keep it as simple as possible first, no pinning
-
@zmitchell: I’m not sure what angle brackets do, what is there in the
NIX_PATH
. Determinate systems installer might not install channels - @infinisil: That’s not great, there’s no common grounds
-
@fricklerhandwerk: Could fetch the channel inline using
channel:
URL syntax -
@zmitchell: Also get rid of
with pkgs;
imo
-
@henrik-ch: How about we only link to specific sections of the language tutorial as a prerequisite
-
@zmitchell: Go from
nix-shell -p
into how to save that environment to a file -
@zmitchell: Not sure which tools to pick. Python? Rust? If you want to install packages, do it this exact way that works
-
@fricklerhandwerk:
lolcat
, etc. was chosen to not capture (or lose) any specific audience. Any programming language or tooling needs config, packages, etc. which becomes harder and more involved with Nix -
Example to anchor everything on:
let pkgs = import (fetchTarball channel:nixos-22.11) {}; in pkgs.mkShell { buildInputs = with pkgs; [ git neovim nodejs ]; }
-
@infinisil, @zmitchell: Maybe no
with pkgs;
?-
@fricklerhandwerk: reduces visual noise, appropriately represents the complexity of the task at hand
- still easy to explain: names/items in the
pkgs
collection/object/dict/attrset are available for adding to that list directly
- still easy to explain: names/items in the
-
@fricklerhandwerk: reduces visual noise, appropriately represents the complexity of the task at hand
-
@infinisil, @zmitchell: Maybe no
-
- Conclusions:
- Minimal amount of Nix language requirements
- switch order of tutorials, move pinning to later
- Installation
nix-shell -p
shell.nix
-
@zmitchell: Not sure about which tools should appear in
nix-shell -p
andshell.nix
tutorials. Some language? Which one?- @fricklerhandwerk: We’d have to check whether you can do Rust without running into problems, same for Python, Node, include all three, including neovim. Then later follow-up with home-manager for the user-facing setup of neovim, moving it out of the shell.nix
- @henrik-ch: Could allow readers to select the tools. Maybe sizing up a smaller tutorial would be good too
- @fricklerhandwerk: Branching is probably the best way to do things, because then one can go into fully working examples
- otherwise you run the risk of people trying
pip install -r
and failing miserable - @erooke: Maybe flamegraph
-
@zmitchell: Something that doesn’t need configuration
-
@infinisil:
make
,jq
,curl
, curl the GitHub API, process with jq. Maybe a Python script without deps
-
@infinisil:
- Maybe not Python, could lead into problems with
pip
, etc.-
@khaled: I like the Python idea
- @infinisil: How about doing that later, start off without config
-
@khaled: I like the Python idea
-
@fricklerhandwerk: GitHub - agarrharr/awesome-cli-apps: 🖥 📊 🕹 🛠 A curated list of command line apps
- advanced replacements for POSIX tools, not installed by default anywhere:
-
tre
,rg
,fd
,bat
,exa
-
- fancy CLI tools
-
ranger
,entr
,tmate
-
- advanced replacements for POSIX tools, not installed by default anywhere:
- @infinisil: Maybe keep it simpler for the start, use tools most people will know
-
@zmitchell: Like the idea of querying the GitHub API using
curl
andjq
-
@fricklerhandwerk: What about
gh
, the GitHub CLI?-
@infinisil We can use part of the API without logging in using just
curl
andjq
- @fricklerhandwerk: yes, should use something with minimal dependencies
-
@infinisil We can use part of the API without logging in using just
- @infinisil: Show how users can figure out their GitHub ID, as necessary to be added as a maintainer, see here
- Conclusions on tools for the
shell.nix
example:- should be relevant to software developers (target audience)
- must be programming langauge agnostic
- must be command-line only
- must not require configuration or accounts
- should not be trivially available on vanilla distributions
Action items
- @zmitchell: Does Rust work without Nix integration
-
@khaled: Find prior
shell.nix
tutorials, see https://github.com/NixOS/nix.dev/blob/00da03358f0d4b357d0693229b95ab7be48981ca/maintainers/working_groups/learning_journey/documentation-survey.md as a start - @henrik-ch: Annotate the documentation survey items
-
@erooke: Implement the proposed changes to the
nix-shell -p
andshell.nix
tutorials we discussed here, PR to nix.dev - @fricklerhandwerk: Figure out how to do section headers in sphinx, see also Tracking issue - re-shape current content into a structure based on Diataxis · Issue #499 · NixOS/nix.dev · GitHub