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

580 commits

Author SHA1 Message Date
Yuki Langley 3f95a892ff
Rewrite "Set up development environment" (#376)
* Rewrite "Set up development environment"

The previous version is specific to Python as it uses
`buildPythonApplication` instead of `mkShell`.

This one is more general but maintains the same Python Flask web
application example.

* Update pinning-nixpkgs to use 22.11

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-12-10 04:33:06 +01:00
Yuki Langley 8522325436
Add information on contributing documentation (#371)
* Add information on contributing documentation

* Refer to quick start on adding new packages

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-12-10 04:24:06 +01:00
Yuki Langley e9601db8c4 Only show top-level categories on front-page 2022-12-09 14:51:38 +01:00
Yuki Langley 6df9bfc5e0
Update source/tutorials/index.md
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-12-09 14:46:01 +01:00
Yuki Langley d58f1503da Remove information overload from toctrees 2022-12-08 20:45:53 +01:00
Yuki Langley 428416093c
Mention WSL 2 systemd support (#406) 2022-12-04 09:16:32 +01:00
Henrik fa6aebeea6
Correction in calling functions section (#402)
* correction in calling functions section

List elements separated by white space
examples were not generating correctly.
2022-11-26 01:24:13 +01:00
Jörg Thalheim 858bf0eae3
nix-language: attempt to simplify concept overview (#397)
In the current text its not even for me clear what it is referring to. This rewrite tries to give more examples for each concept of the language.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-11-24 10:05:32 +01:00
Valentin Gagarin 6ae488e715
Merge pull request #388 from fricklerhandwerk/nix-language-introduction
rework parentheses example
2022-11-18 17:16:39 +01:00
Valentin Gagarin ec14804aee
Merge pull request #387 from fricklerhandwerk/nix-language-examples
refine worked examples
2022-11-18 17:15:50 +01:00
Valentin Gagarin dd8e3f6aa3
Merge pull request #386 from fricklerhandwerk/nix-language-tutorial
Nix language tutorial: add explanation on how `pkgs.lib` is obtained
2022-11-18 17:15:15 +01:00
Valentin Gagarin 8efe974f67
Merge pull request #392 from fricklerhandwerk/nix-language-derivation 2022-11-12 12:09:49 +01:00
Valentin Gagarin a2f10f337f fix wording on derivations
most importantly, derivations are not a special data type, but only
a certain kind of attribute set with two magic attributes.

we don't go into the details of the magic here, because it's really hard
to explain concisely. it would only distract from the surface feature
we care about here: composition through store paths.
2022-11-11 10:40:33 +01:00
Valentin Gagarin ad19f50231 fix typos, grammar, indentation 2022-11-09 11:14:04 +01:00
Valentin Gagarin ecf756298f
Update source/tutorials/nix-language.md 2022-11-08 20:40:39 +01:00
Yuki Langley ac06c07360 Make code blocks consistent
Illustration of shell sessions or terminals should use shell-session.

Entire expressions should be encapsulated in code blocks, not inline code.
2022-11-08 17:37:41 +01:00
Valentin Gagarin ade558c532 rework parentheses example
it was reported that the list example was confusing and lacked
explanation.

moved the example to function application, and reduced the syntax notes
to "notes on whitespace". moved the emphasis on the goals of this
tutorial to its proper place in the introduction.

it's good to leave the whitespace notes in the introductory part,
because they are unspecific and clearly belong to the "don't worry, it
may look weird, but that doesn't matter" part.
2022-11-08 14:28:01 +01:00
Valentin Gagarin 9b63c68d5c refine worked examples
it was reported that the NixOS configuration is confusing, because
information is lacking to understand what it does.

added another note reminding of this tutorial's objective.

added section headings to give hints where to look next.
2022-11-08 13:35:51 +01:00
Valentin Gagarin 3b775207a5 clarify how library functions are implemented 2022-11-08 13:16:53 +01:00
Valentin Gagarin 4a18a5ffdc add explanation on how pkgs.lib is obtained 2022-11-08 12:38:20 +01:00
Yuki Langley a4a6ce812b Rewrite GitHub anchor links to user-content-
Due to an Sphinx issue[1], linkcheck fails on GitHub anchors for
GitHub rendered documents.

This change rewrites the anchors to the ones that can be verified by
linkcheck.

[1]: https://github.com/sphinx-doc/sphinx/issues/9016
2022-11-03 17:36:40 +01:00
Yuki Langley 9b01513c45 Fold terminology section to glossary document
Resolves https://github.com/NixOS/nix.dev/issues/377
2022-10-28 19:47:15 +02:00
Valentin Gagarin 6b6dac8a6b
Merge pull request #343 from jherland/nix-language-readthrough
Nix language tutorial: fix typos, add notes
2022-10-27 10:06:15 +02:00
Niklas Hambüchen 5d4cadace9
integration testing: Fix attribute name for interactive testing
According to

70ec3b9f54/nixos/doc/manual/development/running-nixos-tests-interactively.section.md (running-tests-interactively-sec-running-nixos-tests-interactively)

`driverInteractive` is needed, and just `driver` indeed just runs through
without giving me an interactive shell.
2022-10-25 13:54:53 +02:00
Yuki Langley 3effde4b66 Use possesive not contraction 2022-10-22 17:35:41 +02:00
Yuki Langley 34455a9d5b Add filtered list of issues for each concern 2022-10-22 17:34:06 +02:00
Nejc Zupan 5ab8d5a77f Fix leftovers from .rst -> .md migration
Sphinx doesn't care about filetype suffixes so we didn't see any errors.

But it's still nice to do this bit of gardening, I suppose?
2022-10-22 17:21:04 +02:00
Yuki Langley 4f33a6d07c Move contributing from tutorials to top-level 2022-10-22 15:13:27 +02:00
Johan Herland 7017fdbb00 Warn about combining paths and antiquotation too early in the tutorial
This is the point in the tutorial where I started playing around with
paths and antiquotation in a `nix repl` session and got seriously
confused for a few minutes...

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-10-19 12:01:09 +02:00
Johan Herland 17b1bd8c2e Add a sentence on what happens to antiquoted dirs (vs. files) 2022-10-19 12:00:42 +02:00
Johan Herland eb0615c397 Clarify explanation under the NixOS config example
Split one long point into two to make things clearer.

Also explain what happens to the `./hardware-configuration.nix` when evaluated.
2022-10-19 12:00:42 +02:00
Johan Herland 07098339b2 Minor clarifying reword
Without this, it almost sounds like you can bind a function to any other value.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-10-19 12:00:42 +02:00
Valentin Gagarin 2dbfa6dda5 add 'customizing packages' to recommended reading 2022-10-18 18:26:06 +02:00
Valentin Gagarin fbf2bbbfc7 reorganize recommended reading 2022-10-18 18:25:57 +02:00
Johan Herland 4b9563eb5d Fix typo 2022-10-17 13:33:14 +02:00
Valentin Gagarin 8cf6831eab
Merge pull request #342 from lafrenierejm/fix-typo 2022-10-17 07:51:47 +02:00
Joseph M LaFreniere 933096363c
Fix typo "lanuage" to "language" 2022-10-16 20:13:03 -05:00
Domen Kožar e269b465e7
github actions: bump versions 2022-10-12 14:23:52 +01:00
Valentin Gagarin befd5ef784
Merge pull request #324 from GuillaumeDesforges/patch-1
Add section "Videos" to `recommended-reading.md`
2022-10-08 00:55:15 +02:00
Yann Hamdaoui 7bd6c145bc
Fix typo in Nix language tutorial
Fix the evaluation result of an example which missed enclosing brackets.
2022-10-04 17:04:51 +02:00
Valentin Gagarin a68cf03133 rework section on purity, move antiquotation up 2022-10-04 08:34:34 +02:00
Valentin Gagarin 0bfd4b1bb2 add introductory notes on syntax 2022-10-04 08:34:34 +02:00
Valentin Gagarin abb1808c31 guide -> tutorial 2022-10-04 08:34:34 +02:00
Valentin Gagarin df7024c253 a Linux distribution 2022-10-04 08:34:34 +02:00
Valentin Gagarin 39cfb88480 show inherit inside let 2022-10-04 08:34:34 +02:00
Valentin Gagarin e711230b39 attribute sets are actually ordered 2022-10-04 08:34:34 +02:00
Valentin Gagarin b8e80af94a a derivation 2022-10-04 08:34:33 +02:00
Valentin Gagarin 014e0e507b remove too detailed details 2022-10-04 08:34:33 +02:00
Valentin Gagarin a2fe15959e rework import and side effects
based on detailed review by @infinisil
2022-10-04 08:34:33 +02:00
Valentin Gagarin cf9c8c1919 improve wording on attribute set arguments 2022-10-04 08:34:33 +02:00
Valentin Gagarin 46f1c25277 more clarifications on curried functions 2022-10-04 08:34:33 +02:00
Valentin Gagarin 961bb2766a be more precise what we cover here
most importantly, the "elements of programming" approach is understood
in a broader sence. we don't really deal with operators and just subsume
them under functions.
2022-10-04 08:34:33 +02:00
Valentin Gagarin e64b2059e0 flarify role of NixOS 2022-10-04 08:34:33 +02:00
Valentin Gagarin 23c8c80481 note the overview is an overview 2022-10-04 08:34:33 +02:00
Valentin Gagarin e5b77c58fc make Derivations a topic on its own
this pays tribute to its central role in Nix and elegantly removes it
from the part on side effects, whicht it doesn't belong to.
2022-10-04 08:34:33 +02:00
Valentin Gagarin b3407ec6b6 move indented strings to the end
they are the least significant combination of frequency of occurrence
and peculiarity, even if they're really handy.

but remember, the goal is to help people *understand* Nix language code,
not write it effectively.
2022-10-04 08:34:33 +02:00
Valentin Gagarin 90cbe92389 clarify purpose of inherit 2022-10-04 08:34:33 +02:00
Valentin Gagarin 8047c8f16e restructure functions section 2022-10-04 08:34:33 +02:00
Valentin Gagarin 3e89ed3038 search paths are not reproducible at all 2022-10-04 08:34:33 +02:00
Valentin Gagarin f478379550 add missing semicolons 2022-10-04 08:34:33 +02:00
Valentin Gagarin 1d86654878 elaborate on current directory 2022-10-04 08:34:33 +02:00
Valentin Gagarin 69b0858367 add emphasis 2022-10-04 08:34:33 +02:00
Valentin Gagarin 1dd5699888 less strict wording 2022-10-04 08:34:33 +02:00
Valentin Gagarin d2cad3d48e clarify nested functions with parentheses 2022-10-04 08:34:33 +02:00
Valentin Gagarin de6128a8f8 chaining arguments -> multiple arguments
"chaining arguments" is not well-defined, as [noted] by @matta

[notes]: https://github.com/NixOS/nix.dev/pull/267/files#r968597277
2022-10-04 08:34:33 +02:00
Valentin Gagarin f66543da01 Nix language -> the Nix language
as [pointed out] by @matta

[pointed out]: https://github.com/NixOS/nix.dev/pull/267/files#r968574463
2022-10-04 08:34:33 +02:00
Valentin Gagarin ff2c457f32 reword; there are also invalid expressions 2022-10-04 08:34:33 +02:00
Valentin Gagarin e9af30a6ff shorten time estimate
move the section further up, as recommended by @infinisil
2022-10-04 08:34:33 +02:00
Valentin Gagarin d910383580 capitalize list items
according to English style guides such as [1]

[1]: https://www.instructionalsolutions.com/blog/bulleted-list-punctuation
2022-10-04 08:34:33 +02:00
Valentin Gagarin 93706c411e add notes on strict evaluation 2022-10-04 08:34:33 +02:00
Valentin Gagarin 109ae74e94 Update source/tutorials/nix-language.md
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin aaea5b42c0 Update source/tutorials/nix-language.md
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 1fcaaea3b0 Update source/tutorials/nix-language.md
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 68c33e7ed1 Update source/tutorials/nix-language.md
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 7474d830a1 Update source/tutorials/nix-language.md
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 90522e865f expressions are transformed, not simplified
@infinisil: This is a bit misleading, the model isn't that expressions get simplified. Instead it's that each expression type has semantics for how it should be turned into a Nix value.

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 14455c1d86 evaluate to Nix value, not just value
@infinisil: Introducing the concept of a Nix value fits very well here

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin e5260f3d6d libraries are not just functions
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 55eb91bd9e stdenv -> stdenv.mkDerivation
@infinisil: `stdenv` itself is not a builder

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 5938ad044b remove "and" from example list
@infinisil: The "and" would indicate the end of the list

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 506b35311e libraries have more things than functions
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 30d76c858b use less ambiguous grammar for what NixOS is
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin abf0f5e6d3 use consistent grammatical structure in requirements
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 95ce02b793 update Nix manual URLs 2022-10-04 08:34:33 +02:00
Valentin Gagarin 8ac15f8a08 Update source/tutorials/nix-language.md
Co-authored-by: Dan Baker <daniel.n.baker@gmail.com>
2022-10-04 08:34:33 +02:00
Valentin Gagarin 78a43fb28f use consistent terminology
sort out derivation, Derivation, `derivation` and store derivation
2022-10-04 08:34:33 +02:00
Valentin Gagarin adaba6637e fix wording 2022-10-04 08:34:33 +02:00
Valentin Gagarin e0ee7d5597 link to installation instructions 2022-10-04 08:34:33 +02:00
Valentin Gagarin 17bf23546a rework section on side effects 2022-10-04 08:34:33 +02:00
Valentin Gagarin 397a39f9de mention operators
at some point we have to introduce them, even if they are not really
important here.
2022-10-04 08:34:33 +02:00
Valentin Gagarin 8f1dd17106 add proper examples to file system paths 2022-10-04 08:34:33 +02:00
Valentin Gagarin c36c6ed732 rewordings and links 2022-10-04 08:34:33 +02:00
Valentin Gagarin 8a4d87474b add detailed explanations to some examples 2022-10-04 08:34:33 +02:00
Valentin Gagarin cd7e00ba8d reword time estimate 2022-10-04 08:34:33 +02:00
Valentin Gagarin bb9e7d7ab3 Nix package manager -> Nix
based on https://github.com/NixOS/nix.dev/issues/275#issuecomment-1227572104
2022-10-04 08:34:33 +02:00
Valentin Gagarin 7e18f44302 add introduction and cross-linking
this should both help with initial overview and navigation
2022-10-04 08:34:33 +02:00
Valentin Gagarin 5851659340 add detailed explanation to let expression 2022-10-04 08:34:33 +02:00
Valentin Gagarin 4253a0bc7a nixpkgs/lib -> pkgs.lib
this is probably how most people would encounter it, but since there are
so many equivalent representations, maybe it does not matter outside
a dedicated guide to Nixpkgs
2022-10-04 08:34:33 +02:00
Valentin Gagarin 922e018fd6 nixpkgs -> Nixpkgs
based on https://github.com/NixOS/nix.dev/issues/275#issuecomment-1227572104
2022-10-04 08:34:33 +02:00
Valentin Gagarin b084005748 fix copypaste error 2022-10-04 08:34:33 +02:00
Valentin Gagarin aa0bf42491 fix typo in link 2022-10-04 08:34:33 +02:00
Valentin Gagarin 55c4d4feca attempt at detailed explanation 2022-10-04 08:34:33 +02:00
Valentin Gagarin dfc6d1c31f standard -> function 2022-10-04 08:34:33 +02:00
Valentin Gagarin ab8784c2ad add links to next steps 2022-10-04 08:34:33 +02:00
Valentin Gagarin aebc9e91b1 clarifications 2022-10-04 08:34:33 +02:00
Valentin Gagarin d770b13aef add links, fixups 2022-10-04 08:34:33 +02:00
Valentin Gagarin 8ee55cbac1 expand on side effects, add next steps 2022-10-04 08:34:33 +02:00
Valentin Gagarin c9f5ac3f1f show store paths and fetchers 2022-10-04 08:34:33 +02:00
Valentin Gagarin 3a86358dbf add TODO for operators 2022-10-04 08:34:33 +02:00
Valentin Gagarin 92f96cab30 more explicit explanation of partial evaluation 2022-10-04 08:34:33 +02:00
Valentin Gagarin 95f98f6a60 more explicit syntax notes 2022-10-04 08:34:33 +02:00
Valentin Gagarin f791bd4875 nixpkgs is a token 2022-10-04 08:34:33 +02:00
Valentin Gagarin cf0292e470 restructure introduction, show elements of programming
this does not take away information, but presents it in a different
order. put emphasis on that the language does not do all that many
things.
2022-10-04 08:34:33 +02:00
Valentin Gagarin ee6f1e1c33 generate anchors down to heading level 3 2022-10-04 08:34:33 +02:00
Valentin Gagarin d33eedadd3 add imports to side effects 2022-10-04 08:34:33 +02:00
Valentin Gagarin 20789513e8 notes on argument structure 2022-10-04 08:34:33 +02:00
Valentin Gagarin e7807baa57 clarify explanation of nested functions 2022-10-04 08:34:33 +02:00
Valentin Gagarin 9a994092c2 function calls aka function application 2022-10-04 08:34:33 +02:00
Valentin Gagarin 6390aae686 remove superfluous empty line 2022-10-04 08:34:32 +02:00
Valentin Gagarin bd4118ebb2 move search paths to values section 2022-10-04 08:34:32 +02:00
Valentin Gagarin 9b158e60d1 clarify inheriting from attribute 2022-10-04 08:34:32 +02:00
Valentin Gagarin 6c903a6ccf clarify requirements of being able to read code 2022-10-04 08:34:32 +02:00
Valentin Gagarin b0023d2ade add subsections to modes of running examples
reorder to have the REPL first (it's fewer steps)
2022-10-04 08:34:32 +02:00
Valentin Gagarin 155ad688bc explain how to read examples 2022-10-04 08:34:32 +02:00
Valentin Gagarin 6a4e69eef1 remove paths and strings from top-level outline 2022-10-04 08:34:32 +02:00
Valentin Gagarin 2406c22293 emphasize what this guide is about 2022-10-04 08:34:32 +02:00
Valentin Gagarin 61524d0d34 expressions can be nested 2022-10-04 08:34:32 +02:00
Valentin Gagarin 40ca6fc799 note on difference between antiquotation and shell vars 2022-10-04 08:34:32 +02:00
Valentin Gagarin b3a42cffdc expand on strings and antiquotation
move section into "names and values": it should be short enough not to
exhaust readers before we get to functions, and would not make much
sense as an afterthought to functions.
2022-10-04 08:34:32 +02:00
Valentin Gagarin ca37fe15b0 regularize function examples 2022-10-04 08:34:32 +02:00
Valentin Gagarin 43f2895b2c add counter-example to attribute set argument 2022-10-04 08:34:32 +02:00
Valentin Gagarin 23b52d351e add subsection heading 2022-10-04 08:34:32 +02:00
Valentin Gagarin 560268d865 add missing colon 2022-10-04 08:34:32 +02:00
Valentin Gagarin 9015962289 make example explicit 2022-10-04 08:34:32 +02:00
Valentin Gagarin c6a1c90bbf tighter inherit notation 2022-10-04 08:34:32 +02:00
Valentin Gagarin db56937ab3 add developer tools to skills outline 2022-10-04 08:34:31 +02:00
Valentin Gagarin 075df5b67b give language properties more structure 2022-10-04 08:34:31 +02:00
Valentin Gagarin 41250bb231 reorder first sentences 2022-10-04 08:34:31 +02:00
Valentin Gagarin 92e6e2341e add dynamic typing 2022-10-04 08:34:31 +02:00
Valentin Gagarin 80b0dcb8ae expand on single function argument 2022-10-04 08:34:31 +02:00
Valentin Gagarin fa674e3e11 restructure introduction 2022-10-04 08:34:31 +02:00
Valentin Gagarin e5d41c8425 remove word repetition 2022-10-04 08:34:31 +02:00
Valentin Gagarin 3f3a2a432f add recommendaton to search paths 2022-10-04 08:34:31 +02:00
Valentin Gagarin cda602d3fb restructure examples 2022-10-04 08:34:31 +02:00
Valentin Gagarin 4d65ecf82c WIP: side effects 2022-10-04 08:34:31 +02:00
Valentin Gagarin 388e658437 break up long sentence 2022-10-04 08:34:31 +02:00
Valentin Gagarin 339320ffa1 restructure headings
this will have a nicer display in the table of contents
2022-10-04 08:34:31 +02:00
Valentin Gagarin 0c7c1eb594 everyone calls them side effects 2022-10-04 08:34:31 +02:00
Valentin Gagarin 76561aa33a add structure to config example 2022-10-04 08:34:31 +02:00
Valentin Gagarin f5439cdbc4 expand shell example 2022-10-04 08:34:31 +02:00