Commit graph

15 commits

Author SHA1 Message Date
Vincent Ambo
09486d483c docs(nix-1p): import is a builtin, not a keyword
Pointed out by @Gaelan on GH in
https://github.com/tazjin/nix-1p/issues/12

As noted there, some Nix syntax highlighters will colour `import`
differently (e.g. the Emacs nix-mode), but it's not technically a
keyword in the language.

Change-Id: I1bbd36261cda31deb9ba47380a2810e64ba03ea1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8832
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2023-06-19 22:20:39 +00:00
vpfeiffer
55ea15ab83 docs(nix/nix-1p): Update to use final and prev
The convention has changed to use `final` instead of `self` and `prev`
instead of `super`. This new convention is much easier to understand
especially for users that are new to Nix and Nixpkgs.

This change is notable in the Nixpkgs project code. I added a note
mentioning that the official documentation hasn't been update with
this information. The documentation is currently undergoing an
overhaul and that is why I believe this hasn't been reflected in the
nixpkgs documentation as of yet.

Imported-From: https://github.com/tazjin/nix-1p/pull/9/commits
Change-Id: I901df69a564969b1784b3d7ac629cfaf85093acb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6859
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
2022-10-05 11:14:38 +00:00
Vincent Ambo
a9a1a46458 Note recommended use of 'or' in override patterns
This fixes #6
2021-11-14 16:28:37 +03:00
Vincent Ambo
2a098e081b Document binding of attribute set arguments using '@'
First and foremost this is being added because it was lacking, and
nix-1p strives to have fairly complete coverage of all useful
features.

Additionally, as pointed out by @nixinator in #6 there is some
surprising behaviour around how default arguments work in combination
with '@' and I thought this was worth noting.
2021-11-14 16:20:19 +03:00
Vincent Ambo
d28d30477a Note that or works for nested attribute access 2020-11-25 13:41:38 +01:00
Vincent Ambo
3236b7ff28 Add small section about or expressions 2020-11-25 13:40:19 +01:00
Asad Saeeduddin
56a1f03a10 Fix typo in code snippet 2019-12-18 01:00:39 +00:00
Vincent Ambo
5f4664ad5a Fix rendering of pipes in code blocks across dialects
Pipes inside of code blocks inside of tables seem to pose a challenge
for some Markdown renderers. Not a problem for Github's but this page
is occasionally embedded in other documentation (such as nixery.dev)
2019-08-21 10:19:58 +01:00
Vincent Ambo
19d6d5a16c Add table with most important Nix operators 2019-08-07 16:36:28 +01:00
Louis Taylor
d113a91ae8 Fix link to nixdoc 2019-08-02 11:50:35 +01:00
Vincent Ambo
8b325cd791 Make Github's Nix highlighter happy
The highlighter expects that all code blocks are valid expressions (to
some degree) and highlights mismatches in dark red, which is not
particularly pleasant for the reader.

This introduces a "fake" attribute set in the `inherit` section to
please the highlighter.
2019-08-01 23:24:14 +01:00
Vincent Ambo
bb02b01dd0 Add Nix idioms (file lambdas, callPackage, overrides)
These are not strictly speaking language features, but my intention
for this document is that someone can - after reading it - navigate a
large chunk of existing Nix code.
2019-08-01 23:20:56 +01:00
Vincent Ambo
a2610a9b33 Add note about 'rec' in attribute sets 2019-08-01 23:20:38 +01:00
Vincent Ambo
fe3b0d3706 Point people to the issue tracker for ... issue tracking 2019-08-01 22:48:01 +01:00
Vincent Ambo
32e4cfdda4 Check in initial version of nix-1p
Adds the initial version originally published as a gist. This is
already slightly different from the gist in that it contains a section
on derivations.

This is not yet complete.
2019-08-01 22:48:01 +01:00