Usability study session #1

index | next study

1. Bio / Persona

Learned computational linguistics at grad school with Haskell, but had no relevant experience with building software and dealing with dependencies.

2. Prior Nix experience

Never used Nix before, but has to get acquainted with it for a Haskell project that uses it. Only has a vague idea what it might be for, and how to use it on MacOS.

3. Approaches to learning Nix

At first go, googles nix tutorial, reads a few of the results, but only understands what problem Nix is trying to solve at a very high level:

  • packages in Nix store,
  • packages are hashed,
  • there is a custom language to set things up,

but most of the details are elusive. Can’t say how Nix is different from Docker after this quick research.

Likes to go to the heart of the matter when learning, and navigates to nixos.org on the next try. Jumps to the Learn tab immediately without looking at the front page. Finds it great, wonders why dismissed it on first pass, and can tell simply by scanning the titles that Nix is about reproducible, declarative builds.

  • Clicks on First Steps with Nix

    Finds Nix shell environments cool, and grasps right away how they can be useful, but questions are raised after scanning the page:

    • The Nix packages list is useful, but how does one specify a different version of a package?
    • What does nix-env do? Hasn’t come across it before.
    • Are shells other than Bash supported? Wondering as a Fish user because the page only mentions Bash.
  • Moving to article Towards reproducibility

    Finds the article confusing at first, because the article claims that the first example is not reproducible, then quickly gives the solution, but never actually explains why the first Nix expression isn’t reproducible. Some research helps to get the gist.

  • In Ad hoc developer environments, finds the Reproducible executables section confusing, because it is not immediately clear what the example script is: looks like a shell script, but then calling Python commands. Seems to ignore the note below which is incorrectly formatted on nixos.org, but is more prominent in the nix.dev version of the article.

  • Skims the Explore page, perceives it as mostly marketing that looks helpful.

  • Onward to How Nix Works.

    Looks at the latest pull request (NixOS/nixos-homepage #840), reads it slowly and carefully.

    The feature list makes sense (e.g., multiple versions, complete dependencies, atomic upgrades & rollbacks), but can’t figure out the difference between “build-time” and “run-time” from the text itself, and then quickly scrolls past garbage collection.

    Presumes that the “Functional Package Language” and the mention of “Nix expressions” refer to the configuration language used in the examples from before. Knows what a “functional language” is, but finds it hard to reason about what “functional” means in the context of a build process; it probably has to do with reproducibility or purity, but what would a build process not being functional mean? Showing the simplest possible Nix expression would be helpful.

    Finds the page useful as a whole, and thinks to understand what Nix does, especially after looking at the architecture diagram. All in all, the articles elicit ideas what to look for next.

Moving on from nixos.org to Nix Pills (found in Inria’s “Nix tutorial”) to learn more about the Nix language, but instructor prompts to switch to the Nix Language section in the Nix manual.

Personal takeaways after reading it:

  • Makes sense why it is called a functional language.

  • Finds it interesting that the arguments themselves are things that need to be built (e.g., when using the fetchurl package inside the expression).

  • stdenv sounds like a namespace.

  • Questions:

    • What is a “builder”?

    • What will run the example expression?

      Presumes that Nix will run it with some inputs given to it, but not having full understanding of the process still renders the whole thing confusing.

    • What is the shortest possible introduction to the Nix language? (Prefers reading over watching video.)

    • What are these Nix files for: shell.nix, default.nix, flake.nix?

    • What are “flakes”?

QUESTION: How confident do you feel when it comes to reading Nix expressions?
ANSWER: The Haskell background does not make it sound scary.

QUESTION: What would you consider to be your next steps towards learning Nix?
ANSWER: Try to figure out what the CI does with the aforementioned Nix files.

4. Using Nix

The Haskell project is already set up with Nix, and first thought is that the continuous integration tool (CI) uses it to run stuff, but has no clue how to start using Nix.

Trying nix-shell first, after learning that it can be used to set up a local developer environment for the project, but running into an error:

string <> cannot refer to other paths

Assumes that this is a MacOS-specific issue and retries with --show-trace; the output is more verbose, but unfamiliarity with Nix renders it useless. Perhaps Nix has not been installed correctly and tries to re-install it:

  1. Goes to download page
  2. Realizes that Nix may need to be uninstalled first, but how?
    1. Search online for uninstall nix

    2. Settles on using the Uninstall Nix of Inria’s nix-tutorial

    3. Gets errors after following the instructions:

      error: Operation not permitted
      error: Resource busy
      
    4. Runs installer shell command in Bash, and clicks “yes” to all prompts in quick succession, but the errors persist still:

      error: backup files already exist
      
    5. Stumped about how to clean it up (misses the hints in the error message). It does not say to re-run the installer, so tries nix-shell again, but no joy.

    6. Re-runs installer in Zsh, same error as in Bash.

    7. Resolves to re-read the error messages more slowly this time, finds the hints below, and applies the fix.

      `cp /etc/bashrc ~/backup_etcbashrc`
      `cp /etc/bashrc.backup-before-nix ~/bashrcbackup`
      `mv /etc/bashrc.backup-before-nix /etc/bashrc`
      

After the successful re-installing of Nix, nix-shell is still throwing errors:

error: probem with SSL CA cert path

Back to Google, where a merged GitHub pull request (NixOS/nix #4023) looks promising, and the issues referenced in it indeed give a hint to try sudo nix-shell. That seems to do the trick, but some weird packages are seen being installed, and the build does fail eventually. Realizes that the Haskell project is not on the master branch, and gives sudo nix-shell another try after switching back to master.

Session ends here.

archive

4 Likes

Thanks for posting, I love the way you describe one’s learning path.
Though still “the persona” seem to be educated “victims” trying to get a grasp on Nix(OS).
Do I dare to describe a personal reflection publicly?, aaarch what the heck…

I found out about Nix(OS) some years ago after bricking my system trying to install some mailserver software and was adviced in the corresponding IRC chat to start over the installation again, oh no not again following all the installation steps by hand.
Searched for “versioned systems” and found Versioning file system - Wikipedia
choose NILFS (which is an interesting filesystem on its own!) and there was the reference to NixOS NILFS - Wikipedia >> NixOS
As far as I could comprehend it had all I could wish for, since then strugling to get a crasp of it due to time restraints, but still much on a high for all it can provide.
But right now I am still a basic user, wanting to ask the most dumb questions, but the knowledge and in depth topics on this forum prevents “me” for doing so.
So there it is, it might be my own perception, but I really really believe this forum lacks a basic beginners section where one might ask the most basic “dumb” and obvious questions in the hope to receive a reply and perhaps some handholding.

I know replying to these kind of questions would take too much time for the experts who are far to busy keeping everything in shape.
Therefore I was even thinking about starting a beginnix site/forum to provide a (safe :wink: ) place where likeminded people would try together to conquer this Nix(OS) mountain.
I for one would like to invest my time to get together on a regulary basis to learn, exchange ideas, document steps as described in this @toraritte topic, and recording video’s (the three learning styles: reading, listening, watching), so others after us might find our path helpfull. Maybe it can become an extention to the documentation quest @fricklerhandwerk is having at hand.
To eventually become confident to contribute to the project. I would realy like to be able to do so but have to start at a very basic Nix level.
I will get there, but sureley not on my own…

2 Likes

Hey @JosW,
thanks for your feedback. While people do post obscure problems with their Nix setup (and often don’t get answers because they are too specific even for veterans), absolute beginner questions are very welcome and usually greeted with friendly replies on short notice.

In fact, for the forum regulars it is much easier to answer basic questions by linking to authoritative resources or explaining best practices than dealing with intricate technicalities of special cases. It also helps raise awareness of these basic issues, and would help direct how to improve the material and its discoverability - ideally by leveraging the curiosity and energy of those beginners, enabling them to contribute directly.

So by all means, please continue asking questions, even if they appear to sound naive. Those are actually the best.

Note though that development, marketing, and documentation efforts are currently focused on serving the needs of software developers, simply due to time constraints and the fact that this is already the largest fraction of users. In the same vein, the attempt to improve the learning experience is emphasizing Nix instead of NixOS. There is still a very active subgroup of NixOS enthusiasts, but I think we can expect more activity around Nix than NixOS in the near future.

Thanks for the reply, I removed the reference to the different rendering.

1 Like

Been editing my rambling for clarity and re-posted it.

I really enjoyed seeing this thread of user studies. Thank you for doing this!
It would be interesting to see the key trends once you finish with this cycle of user studies and then compare it to another batch in the future to track our progress/change.

3 Likes