Commit graph

132 commits

Author SHA1 Message Date
Valentin Gagarin
b17f200b11
Document "Import From Derivation" (#7332)
* document "Import From Derivation"

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: John Ericson <git@JohnEricson.me>
2023-09-26 01:49:03 +00:00
Valentin Gagarin
c6f8247032 fix broken reference link 2023-09-26 03:10:12 +02:00
Valentin Gagarin
5b0336b3b1 reword example for clarity 2023-09-26 00:58:50 +02:00
Valentin Gagarin
7de66f19f8 example: headers -> dev
make the example more realistic, since `headers` is not an output name
used in Nixpkgs

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-09-26 00:46:27 +02:00
Valentin Gagarin
75a231147f be more precise about system semantics 2023-09-26 00:45:00 +02:00
Valentin Gagarin
5e4734a08b reword to avoid saying "build"
derivations are about data transformation, so the term "build" does not
add any information. there was also some feedback that "build task" is
not more helpful than "derivation" if you have no prior experience with
Nix or build systems, while existing associations may be misleading.
2023-09-26 00:45:00 +02:00
Valentin Gagarin
17884f54d1 clarification on extra attributes
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-09-26 00:45:00 +02:00
Valentin Gagarin
026c24e378 add example for store path using the given name 2023-09-26 00:45:00 +02:00
Valentin Gagarin
d621dd17f2 more precise wording
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-09-26 00:45:00 +02:00
Valentin Gagarin
e2f118efed restructure and reword input attributes section on derivation 2023-09-26 00:43:58 +02:00
Valentin Gagarin
541890463d make separate section for builder execution 2023-09-26 00:43:58 +02:00
Valentin Gagarin
747b2baf21 fix rendering error for consecutive spaces 2023-09-21 02:51:54 +02:00
Valentin Gagarin
0cd8f36644 add anchor to builder 2023-08-31 21:26:15 +02:00
Théophane Hufschmitt
ad410abbe0 Stabilize discard-references
It has been there for a few releases now (landed in 2.14.0), doesn't
seem to cause any major issue and is wanted in a few places
(https://github.com/NixOS/nix/pull/7087#issuecomment-1544471346).
2023-08-07 16:53:37 +02:00
Valentin Gagarin
b0173716f6
clarify wording on args@ default handling (#8596)
* clarify wording on args@ default handling

Most importantly use shorter sentences and emphasize the key point that defaults aren't taken into account

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: John Ericson <git@JohnEricson.me>
2023-07-19 13:07:07 +00:00
Valentin Gagarin
2fa90e5824 add more details on CA derivations 2023-07-19 13:59:18 +02:00
Valentin Gagarin
5f37ebcf83 document all special system features and their behavior 2023-07-19 13:34:03 +02:00
Sinan Mohd
a5c88f8609
Nix Reference Manual: keep nix expressions uptodate with nixpkgs (#8703) 2023-07-16 09:25:11 +00:00
Robert Hensing
32c69e2b17 doc: Typo 2023-06-30 18:22:47 +02:00
John Ericson
22b278e011 Automatically document builtin constants
This is done in roughly the same way builtin functions are documented.

Also auto-link experimental features for primops, subsuming PR #8371.

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-06-27 09:37:54 -04:00
John Ericson
d40f0e534d Don't say this when we still pollute the global scope
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-06-27 09:37:31 -04:00
John Ericson
4da7c86618 Switch example to a primop this is less ill-advised
Any primop will do for this, so might as well use one that isn't impure.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-06-27 09:34:36 -04:00
Valentin Gagarin
c3c4076342 make domain-specificity more specific
also slightly reword the purpose statement to introduce (and explain)
derivations right away.
2023-06-15 03:08:07 +02:00
Valentin Gagarin
db680e0e57
refine wording on the purpose of the Nix language
packages and configurations are not really a concept in Nix or the Nix language. the idea of transforming files into other files clearly captures what it's all about, and the new phrasing should make the term "derivation" more obvious both in terms of meaning and origin.
2023-06-08 02:00:05 +02:00
Théophane Hufschmitt
527eb4a99a
Merge pull request #8317 from fricklerhandwerk/doc-identifier
document identifier syntax for attribute sets
2023-06-02 13:10:27 +02:00
Bernardo Meurer
bf693319f6
feat: add always-allow-substitutes
This adds a new configuration option to Nix, `always-allow-substitutes`,
whose effect is simple: it causes the `allowSubstitutes` attribute in
derivations to be ignored, and for substituters to always be used.

This is extremely valuable for users of Nix in CI, where usually
`nix-build-uncached` is used. There, derivations which disallow
substitutes cause headaches as the inputs for building already-cached
derivations need to be fetched to spuriously rebuild some simple text
file.

This option should be a good middle-ground, since it doesn't imply
rebuilding the world, such as the approach I took in
https://github.com/NixOS/nixpkgs/pull/221048
2023-05-22 19:42:29 +01:00
Valentin Gagarin
6a5a8f51bb add cross-references to pure evaluation mode
use consistent wording everywhere.
add some details on the configuration option documentation.
2023-05-17 15:01:54 +02:00
Valentin Gagarin
549f8dc97b document builtins.currentTime 2023-05-17 13:49:35 +02:00
Valentin Gagarin
d8bfeda164 document identifier syntax for attribute sets
it's more likely for readers to find it right there.

this also slightly rewords examples to make them stand out better.
in the long run there probably needs to be a dedicated section on formal syntax, and better highlighting of examples.
2023-05-17 13:41:34 +02:00
Ana Hobden
17fb346ec6 Describe the or operation on attribute sets slightly more 2023-05-12 11:03:09 -07:00
Valentin Gagarin
70eb9c7ddb reword introduction to built-in functions
add anchor to `builtins.derivation` and list some built-in functions that are
exposed in the global scope.

I decided not to list everything, because we probably don't want to
encourage people using them that way.
2023-05-11 20:07:42 +02:00
Valentin Gagarin
69a0e6f86c reword documentation on builtins
- add anchor to `builtins`
- add type information
- reword description of `builtins` to offer more information concisely
2023-05-11 17:46:37 +02:00
Valentin Gagarin
2ef7f14e28 do not indent markdown list 2023-05-11 15:29:03 +02:00
John Ericson
d93e76fbb8 Start cross-referencing experimental features
- Create a glossary entry for experimental features.

- Have the man page experimental feature notice link `nix-commmand`.

  (Eventually this should be programmed, based on whether the command is
  experimental, and if so what experimental feature does it depend on.)

- Document which installables depend on which experimental features.

  I tried to use the same style (bold warning and block quote) that the
  top of the man page uses.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-04-14 07:45:08 -04:00
Alexander Bantyev
36b059748d Split nix-env and nix-store documentation per-subcommand
Documentation on "classic" commands with many sub-commands are
notoriously hard to discover due to lack of overview and anchor links.
Additionally the information on common options and environment variables
is not accessible offline in man pages, and therefore often overlooked
by readers.

With this change, each sub-command of nix-store and nix-env gets its
own page in the manual (listed in the table of contents), and each own
man page.

Also, man pages for each subcommand now (again) list common options
and environment variables. While this makes each page quite long and
some common parameters don't apply, this should still make it easier
to navigate as that additional information was not accessible on the
command line at all.

It is now possible to run 'nix-store --<subcommand> --help` to display
help pages for the given subcommand.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-03-30 09:46:28 +02:00
Valentin Gagarin
40eb88e427 doc: force line breaks where needed 2023-03-22 22:46:23 +01:00
wzy
5bf4ade0fa
Fix a typo of values.md 2023-03-13 15:34:01 +08:00
Pico Geyer
a0f1cb0ce7 Fix minor syntax issue in the one of the examples.
Attribute set expressions need to end with a ;
2023-02-10 12:01:44 +02:00
Valentin Gagarin
c1921514d4
Merge pull request #7700 from iFreilicht/patch-1
docs: Fix small formatting errors
2023-02-07 23:37:42 +01:00
Felix Uhl
d910dfe978 docs: Fix formatting of || operator
This is a workaround for
[mdBook#2000](https://github.com/rust-lang/mdBook/issues/2000)
2023-02-07 23:06:14 +01:00
Felix Uhl
32db5e6349 docs: Fix broken anchor link 2023-02-07 23:06:14 +01:00
Naïm Favier
2915db7b28
doc: fixup 7714 2023-02-07 11:38:09 +01:00
Naïm Favier
0b3464a107
doc: add __structuredAttrs, outputChecks, unsafeDiscardReferences 2023-01-30 14:49:45 +01:00
Théophane Hufschmitt
4aaf0ee52e
Merge branch 'master' into referenceablePaths 2023-01-30 10:31:00 +01:00
Florian Paul Schmidt
4ff9ed5c2d doc: fix update operator description 2023-01-20 13:21:45 +01:00
Valentin Gagarin
b911307d7a
Merge pull request #7629 from phip1611/patch-3 2023-01-19 16:41:20 +01:00
Philipp Schuster
9469b1bb30 doc: update language/index.md
- make `<nixpkgs>` visible (was blank in the rendered version)
2023-01-19 15:11:20 +01:00
Eelco Dolstra
38b90c618f
Merge pull request #7640 from marceltransier/patch-2
Fix update operator usage in operators.md
2023-01-19 11:12:10 +01:00
Marcel Transier
8b9325ec4a
Fix update operator usage in operators.md 2023-01-19 10:20:41 +01:00
Marcel Transier
9141b74eb7
Fix markdown error in operators.md
Escape logical or pipe in markdown table according to https://github.github.com/gfm/#example-200
2023-01-18 22:34:49 +01:00
Valentin Gagarin
e57165b85a bring back table, extract annotations
this makes the table less unwieldy, and leaves enough space for
extensive explanations.
2023-01-05 15:16:16 +01:00
Valentin Gagarin
7da59e94ae add links to documentation for data types 2023-01-05 14:15:01 +01:00
Valentin Gagarin
7b2b9e3648 use more self-explanatory placeholder names 2023-01-05 14:15:01 +01:00
Valentin Gagarin
969e5ad5bf add semantics of overloaded + operator 2023-01-05 14:15:01 +01:00
Valentin Gagarin
63b640e0c2 reword descriptions of operators
add notes on semantics where appropriate
2023-01-05 14:15:01 +01:00
Valentin Gagarin
e07448ba6b convert table to subsections
this form is much easier to maintain (also with minimal diffs), and
allows for more details on each operator.

this change a purely mechanical transformation, without changing any contents.
2023-01-05 14:15:01 +01:00
Valentin Gagarin
caebe4112e reorder columns
this is for a simpler transformation into a series of subsections
2023-01-05 14:15:01 +01:00
Naïm Favier
15f7fa59be
unsafeDiscardReferences
Adds a new boolean structured attribute
`outputChecks.<output>.unsafeDiscardReferences` which disables scanning
an output for runtime references.

    __structuredAttrs = true;
    outputChecks.out.unsafeDiscardReferences = true;

This is useful when creating filesystem images containing their own embedded Nix
store: they are self-contained blobs of data with no runtime dependencies.

Setting this attribute requires the experimental feature
`discard-references` to be enabled.
2023-01-03 17:19:16 +01:00
Valentin Gagarin
e0c4a95611 antiquotation -> string interpolation
as proposed by @mkaito[1] and @tazjin[2] and discussed with @edolstra
and Nix maintainers

[1]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270076332
[2]: https://github.com/NixOS/nix.dev/pull/267#issuecomment-1270201979

Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2023-01-02 14:38:57 +01:00
Valentin Gagarin
52f0c80917 fix error in language overview
it is not possible to antiquote numbers.
2022-11-22 10:36:21 +01:00
Valentin Gagarin
ffca3e34cb
Merge pull request #6906 from fricklerhandwerk/language-overview
add syntax overview from NixOS manual
2022-11-09 00:52:53 +01:00
Valentin Gagarin
f7ab93b068 manual: build action -> build task
after discussing this with multiple people, I'm convinced that "build
task" is more precise: a derivation is not an action, but inert until it
is built. also it's easier to pronounce.

proposal: use "build task" for the generic concept "description of how
to derive new files from the contents of existing files". then it will
be easier to distinguish what we mean by "derivation" (a specific data
structure and Nix language value type) and "store derivation" (a
serialisation of a derivation into a file in the Nix store).
2022-11-06 13:28:18 +01:00
Johan Herland
1ec8810687 Explain how Nix handles antiquotation of paths
Specifically, explain why Nix does not _re_evaluate paths during a
`nix repl` session. This is a thing that bit me while playing around
with paths and antiquotation in `nix repl` while reading the Nix
language tutorial at https://nix.dev/tutorials/nix-language.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-10-19 11:50:58 +02:00
Valentin Gagarin
f35b3aa47b do not use unwarranted pkgs in example 2022-08-31 09:16:37 +02:00
Valentin Gagarin
703b335c1d reword description of language properties
the list style is supposed to give more structure.
each property is explained as concisely as possible while trying not to
sound too fancy.
2022-08-15 11:34:39 +02:00
Valentin Gagarin
71e9c28694 reword introduction to overview 2022-08-15 11:15:03 +02:00
Valentin Gagarin
bc315326fa fix whitespace to please markdown
keep some indentation to ease source readability
2022-08-15 11:13:05 +02:00
Valentin Gagarin
6ba8d6dc82 add more examples on string interpolation 2022-08-15 11:06:40 +02:00
Valentin Gagarin
c209e6e108 add more list examples 2022-08-15 10:18:56 +02:00
Valentin Gagarin
0378531bf2 add curried function 2022-08-15 10:18:56 +02:00
Valentin Gagarin
2e4704ca93 add second @ pattern example 2022-08-15 10:18:56 +02:00
Valentin Gagarin
5c25bdee50 add null 2022-08-15 10:18:56 +02:00
Valentin Gagarin
391fd10b12 add home path 2022-08-15 10:18:56 +02:00
Valentin Gagarin
587ae9ada5 add search path 2022-08-15 10:18:56 +02:00
Valentin Gagarin
21438acc70 add absolute path 2022-08-15 10:18:56 +02:00
Valentin Gagarin
e6f7c180de add floating point number 2022-08-15 10:18:56 +02:00
Valentin Gagarin
292cab039d add multi-line string 2022-08-15 10:18:56 +02:00
Valentin Gagarin
f165a8ae08 flarify relative path semantics 2022-08-15 10:18:56 +02:00
Valentin Gagarin
43188d3d18 make hash and version distinguishable as placeholder 2022-08-15 10:18:56 +02:00
Valentin Gagarin
90836397d3 remove stale section link 2022-08-15 10:18:56 +02:00
Valentin Gagarin
3378a3bce8 add syntax overview from NixOS manual
taken verbatim to keep track of required corrections.

made it an HTML table to more easily change structure and keep diffs
minimal.
2022-08-15 10:18:56 +02:00
Valentin Gagarin
499ed26508 manual: remove "Writing Nix Expressions" chapter
it is out of date, all over the place in level of detail, is really
about `nixpkgs`, and in general instructions should not be part of
a reference manual.

also:
- update redirects and internal links
- use "Nix language" consistently
2022-08-04 11:59:25 +02:00