1
0
Fork 0
mirror of https://github.com/NixOS/nix.dev.git synced 2024-10-18 14:32:43 -04:00

Merge pull request #267 from fricklerhandwerk/nix-language-tutorial

Nix language tutorial
This commit is contained in:
Domen Kožar 2022-10-04 15:38:06 +02:00 committed by GitHub
commit 70b0fb5e8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1771 additions and 1 deletions

View file

@ -7,6 +7,7 @@ Nix syntax supports URLs as verbatim, so one can write `https://example.com` ins
There's was an [RFC 45](https://github.com/NixOS/rfcs/pull/45) accepted to deprecate verbatim URLS and provides
a number of arguments how this feature does more harm than good.
(rec-expression)=
## `rec { ... }` expression
`rec` allows you to reference variables within an attribute set.
@ -87,6 +88,7 @@ buildInputs = builtins.attrValues {
buildInputs = lib.attrVals ["curl" "jq"] pkgs
```
(search-path)=
## `<...>` search path
You will often see Nix language code samples that refer to `<nixpkgs>`.

View file

@ -52,7 +52,7 @@ myst_enable_extensions = [
]
# GitHub-style automatic anchors for headings
myst_heading_anchors = 2
myst_heading_anchors = 3
copybutton_prompt_text = r"# |\$ "

View file

@ -153,6 +153,7 @@ All the subsequent `#! nix-shell` lines are used to build up the shell's configu
We've only covered the bare essentials of Nix here. Once you're comfortable with these examples, take a look at:
- {ref}`reading-nix-language` to learn about the Nix language, which is used to declare packages and configurations.
- {ref}`pinning-nixpkgs` to see different ways to import Nixpkgs.
- {ref}`declarative-reproducible-envs` to create reproducible shell environments given a declarative configuration file called a Nix expression.
- [Garbage Collection](https://nixos.org/manual/nix/stable/package-management/garbage-collection.html)- as when using `nix-shell`, packages are downloaded into `/nix/store`, but never removed.

View file

@ -5,6 +5,7 @@
install-nix.rst
ad-hoc-developer-environments.rst
nix-language.rst
towards-reproducibility-pinning-nixpkgs.rst
declarative-and-reproducible-developer-environments.rst
continuous-integration-github-actions.rst

File diff suppressed because it is too large Load diff