Open zmitchell opened 1 year ago
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-04-13-learning-journey-working-group-meeting-notes-4/27255/1
A collection of existing tutorials with notes about what they cover:
An introduction to nix-shell (2020/07/08)
Effortless dev environments with Nix and direnv (2022/10/23) (flakes)
use flake <url>
)use flake
sHow Nix-Shell Saved Our Team’s Sanity (2021/10/27)
A Tutorial Introduction To Nix (2020/08/18)
--argstr
Howto manage shareable, reproducible Nix environments via nix-shell (2023/01/09)
pythonPackages
Environments with Nix Shell - Learning Nix pt 1 (2018/01/29)
shell.nix
Tools You Should Know About: nix-shell (2021/12/19)
From existing doc survey:
nix-shell
Comand Reference -> Main Commands -> nix-shell Nix-shell shebang
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-04-20-learning-journey-working-group-meeting-notes-5/27460/1
I have a flake.nix
with a mkShell
in it. Is that equivalent?
The tutorial also does not mention whether shell.nix
is a hard convention or something.
The agreed-upon tenet at the moment is to only teach using the stable interface, and Flakes are an experimental feature. Other than that, yes, it's equivalent.
shell.nix
is the default filename taken by nix-shell
(see the Nix manual).
OK. In his tutorial here Amos focuses heavily on flake: https://fasterthanli.me/series/building-a-rust-service-with-nix/part-9
@roberth assigned to you for feedback
- This
shell.nix
will just grab nixpkgs from<nixpkgs>
, leaving pinning, channels, etc to later tutorials
I think the guide should still mention this in a warning / note, or at least the kind of issues that comes from not pinning
Regarding not using flakes, it would be beneficial to make clear in the tutorial which parts of the file are about bring things into scope, and which part is the actual shell expression. As this is "First steps" they're not too familiar with the language yet, so some extra guidance as to what's what will help them transfer this knowledge to a flake context.
Furthermore some of these points apply; some context to keep in mind while writing this tutorial
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-07-13-learning-journey-working-group-meeting-notes-17/30393/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-07-17-tutorial-series-call-for-feedback/30616/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2023-07-27-learning-journey-working-group-meeting-notes-19/31151/1
Cleaning out issues and compiling a refreshed overview, I think what we're still missing is a smooth transition between a very superficial look at Nix expressions (e.g. in the context of shell.nix
) and the hefty Nix language basics tutorial. I renamed the issue accordingly to make it fit into the new overview.
The Learning Journey WG identified that the second tutorial in the learning journey should be a tutorial walking the user through creating a
shell.nix
. This is the tracking issue for discussion on this tutorial and related work.shell.nix
tutorials (@khaled)Tutorial contents
shell.nix
installing Pythonnix-shell -p
you can enter the same environment repeatedly by declaring it in ashell.nix
file.shell.nix
to configure other aspects of the environment:buildInputs
andpackages
shell.nix
will just grab nixpkgs from<nixpkgs>
, leaving pinning, channels, etc to later tutorialsHow