# Official Nix Language Cheat Sheet

**URL:** https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244
**Category:** Marketing
**Created:** [May 11, 2024, 3:30pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244 "2024-05-11T15:30:06Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![djacu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/djacu/32/16954_2.png) [@djacu](https://discourse.nixos.org/u/djacu)
#### Post date: [May 11, 2024, 3:30pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/1 "2024-05-11T15:30:06Z")

</div>

Hey everyone

I’ve just submitted a PR to add an official Nix language cheat sheet to the marketing repository ([Add cheat sheets #7](https://github.com/NixOS/marketing/pull/7)). The cheat sheet is available in A4 and Letter paper sizes and in full color and (mostly) grayscale. This is part of a larger effort by the marketing team to create and collect swag that we can distribute at future NixCon and other large events.

---

<div class="post-metadata">

### Author: ![sirphobos](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sirphobos/32/9195_2.png) [@sirphobos](https://discourse.nixos.org/u/sirphobos)
#### Post date: [May 11, 2024, 5:39pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/2 "2024-05-11T17:39:41Z")

</div>

I would so much appreciate a cheat sheet for functions from builtins and nixpkgs’s lib (and from packages too, such as buildEnv) - sometimes i just can neither find the one i need at a certain moment, nor remember some function I already used later.

---

<div class="post-metadata">

### Author: ![djacu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/djacu/32/16954_2.png) [@djacu](https://discourse.nixos.org/u/djacu)
#### Post date: [May 11, 2024, 5:41pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/3 "2024-05-11T17:41:40Z")

</div>

That’s a pretty good idea. Although there are a _lot_ of builtins and library functions.

Until one materializes, have you tried using [https://noogle.dev/](https://noogle.dev/)?

---

<div class="post-metadata">

### Author: ![sirphobos](https://discourse.nixos.org/user_avatar/discourse.nixos.org/sirphobos/32/9195_2.png) [@sirphobos](https://discourse.nixos.org/u/sirphobos)
#### Post date: [May 11, 2024, 5:50pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/4 "2024-05-11T17:50:07Z")

</div>

oh, interesting resource, thank you.

I notice that there is a lot of 3rd party resources popping up around nix, but unless I manage to catch a discussion about one here on discoruse - i’d probably never find it on my own.

but as for what it is - it’s a good to find a manual entry for a function you know by name, but not that good for discovering a function that you didn’t know exists.  
Also I see it misses docs for functions from pkgs, such as all kind of builders. But, unfortunately, for those even nixos/nixpkgs manuals do not contain full reference entries, usually I’m forced to look into their code.

---

<div class="post-metadata">

### Author: ![drupol](https://discourse.nixos.org/user_avatar/discourse.nixos.org/drupol/32/9471_2.png) [@drupol](https://discourse.nixos.org/u/drupol)
#### Post date: [May 11, 2024, 8:40pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/5 "2024-05-11T20:40:36Z")

</div>

Cool… I had the idea to do something similar using [Typst](https://typst.app/) to facilitate user contributions.

---

<div class="post-metadata">

### Author: ![djacu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/djacu/32/16954_2.png) [@djacu](https://discourse.nixos.org/u/djacu)
#### Post date: [May 11, 2024, 8:45pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/6 "2024-05-11T20:45:16Z")

</div>

I’ve looked at Typst but never tried it. It looks really cool and I’ve heard the barrier to entry is a lot lower. What’s your experience with it?

---

<div class="post-metadata">

### Author: ![nyanbinary](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nyanbinary/32/11523_2.png) [@nyanbinary](https://discourse.nixos.org/u/nyanbinary)
#### Post date: [May 11, 2024, 8:54pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/7 "2024-05-11T20:54:10Z")

</div>

Honestly, a whole series of cheat sheets like this would be really nice to have in general, bite-size format for information like this is generally nice to see.

---

<div class="post-metadata">

### Author: ![djacu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/djacu/32/16954_2.png) [@djacu](https://discourse.nixos.org/u/djacu)
#### Post date: [May 11, 2024, 8:58pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/8 "2024-05-11T20:58:23Z")

</div>

I do have plans to add a nix commands (and maybe repl) cheat sheet. And @sirphobos’s comment has me thinking about one for builtins and functions.

Any other thoughts about what would make for a helpful cheat sheet?

---

<div class="post-metadata">

### Author: ![drupol](https://discourse.nixos.org/user_avatar/discourse.nixos.org/drupol/32/9471_2.png) [@drupol](https://discourse.nixos.org/u/drupol)
#### Post date: [May 11, 2024, 8:59pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/9 "2024-05-11T20:59:56Z")

</div>

Typst? This is a wonderful piece of software. I was a convinced user of LaTeX (ex: [ECPHP / sessions · GitLab](https://code.europa.eu/ecphp/sessions)) for years… and since I tried Typst, I never went back to using LaTeX…

I’m using Typst for writing letters, making [presentations](https://github.com/drupol/ipc2023/releases/tag/v23-79efbb4c24ab0d42c73906d16233a79d9659c5ca)…

---

<div class="post-metadata">

### Author: ![djacu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/djacu/32/16954_2.png) [@djacu](https://discourse.nixos.org/u/djacu)
#### Post date: [May 11, 2024, 9:13pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/10 "2024-05-11T21:13:16Z")

</div>

This is pretty sick! Okay I’m convinced. I’m going to take a look at converting to typst after this PR goes through.

I was poking around a bit in your repo. How do you make it work so you can use packages from the typst universe?

---

<div class="post-metadata">

### Author: ![drupol](https://discourse.nixos.org/user_avatar/discourse.nixos.org/drupol/32/9471_2.png) [@drupol](https://discourse.nixos.org/u/drupol)
#### Post date: [May 11, 2024, 9:19pm UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/11 "2024-05-11T21:19:42Z")

</div>

I just uploaded the latest nix files I usually use for Typst projects: [Flake for Typst · GitHub](https://gist.github.com/drupol/3a05991527cdf40da6b46629fd9f5089)

Once in your repo, create the file: `src/<name-of-the-document>/main.typ`, then the scripts `build-<name-of-the-document>` and `watch-<name-of-the-document>` will be available.

The packages from Typst universe should also be available.

---

<div class="post-metadata">

### Author: ![Pamplemousse](https://discourse.nixos.org/user_avatar/discourse.nixos.org/pamplemousse/32/2847_2.png) [@Pamplemousse](https://discourse.nixos.org/u/Pamplemousse)
#### Post date: [May 13, 2024, 11:36am UTC](https://discourse.nixos.org/t/official-nix-language-cheat-sheet/45244/12 "2024-05-13T11:36:31Z")

</div>

I have a note somewhere telling me to look at making `builtins` and `lib` cheatsheets for [`navi`](https://github.com/denisidoro/navi)… Still haven’t tried it out.

I am pretty convinced that we could generate them as part of the documentation generation process: syntax is pretty simple (_c.f._ [navi/docs/cheatsheet\_syntax.md at 7575ca2435c6032881d637135d8f00d4cc1e8f94 · denisidoro/navi · GitHub](https://github.com/denisidoro/navi/blob/7575ca2435c6032881d637135d8f00d4cc1e8f94/docs/cheatsheet_syntax.md)).

It would make the cheatsheets usable from CLI, interactively, without internet connection.
