Skip to content

Nix language primer with shell.nix #516

@zmitchell

Description

@zmitchell

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.

  • Compile a survey of shell.nix tutorials (@khaled)
  • Consider if there are elements of existing tutorials that we should include
  • Prepare an outline of the tutorial
  • Prepare a draft of the tutorial
  • Submit the draft as a PR

Tutorial contents

  • Provide the reader with a small, functioning shell.nix installing Python
  • Explain that once you've experimented with packages via nix-shell -p you can enter the same environment repeatedly by declaring it in a shell.nix file.
  • You can also use shell.nix to configure other aspects of the environment:
    • Environment variables
    • Shell hooks
    • Shell prompts
  • Illustrate how to add packages to the shell, explaining the basic differences between buildInputs and packages
  • This shell.nix will just grab nixpkgs from <nixpkgs>, leaving pinning, channels, etc to later tutorials

How

Metadata

Metadata

Assignees

Labels

trackingA stopgap for issue dependenciestutorialTopics for new tutorials

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions