Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix language basics RITZA edit #6

Open
wants to merge 2 commits into
base: nix-language-tutorial
Choose a base branch
from

Conversation

worktheclock
Copy link

No description provided.

@worktheclock
Copy link
Author

I have read the CLA Document and I hereby sign the CLA.

Copy link
Owner

@fricklerhandwerk fricklerhandwerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have not seen this in due time for some reason. This is really helpful.

I will revert the changes I disagree with myself, and merge afterwards.

@@ -16,7 +16,7 @@ Notable uses of the Nix language are:

A Linux distribution that can be configured fully declaratively and is based on Nix and Nixpkgs.

Its underlying modular configuration system is written in the Nix language, and uses packages from Nixpkgs.
Its underlying modular configuration system is written in the Nix language and uses packages from Nixpkgs.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comma was for emphasis.

@@ -65,7 +65,7 @@ See the [Nix manual][manual-language] for a full language reference.
- Familiar with functional programming: 1 hour
- Proficient with functional programming: 30 minutes

We recommend to run all examples.
We recommend you run all examples.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We recommend you run all examples.
We recommend running all examples.

Does that fit better?


:::{important}
A build task in Nix is called a *derivation*.
:::

The Nix language has only few basic constructs which can be combined arbitrarily:
The Nix language has a few basic constructs which can be combined arbitrarily:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Nix language has a few basic constructs which can be combined arbitrarily:
The Nix language has a small number of basic constructs which can be combined arbitrarily:

Does that convey the meaning more precisely? I want to emphasize "there are not many of them", not colloquially "there are only a couple of them".

@@ -433,7 +433,7 @@ Counter-example:
(let)=
### `let ... in ...`

Also known as `let` expression or `let` binding
Also known as "`let` expression" or "`let` binding"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original is typographically correct. It's just more annoying to edit.

@@ -934,7 +934,7 @@ For example, `<nixpkgs/lib>` points to the subdirectory `lib` of that file syste

/nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib

While you will see many such examples, we recommend to [avoid search paths](search-path) in practice, as they are [impurities](impurities) which are not reproducible.
While you will see many such examples, we recommend you [avoid search paths](search-path) in practice, as they are [impurities](impurities), which are not reproducible.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
While you will see many such examples, we recommend you [avoid search paths](search-path) in practice, as they are [impurities](impurities), which are not reproducible.
While you will see many such examples, we recommend [avoiding search paths](search-path) in practice, as they are [impurities](impurities), which are not reproducible.


Nix functions take exactly one argument.
Multiple arguments can be handled by nesting functions.

Such a nested function can be used like a function that takes multiple arguments, but offers additional flexibility.
Such a nested function can be used like a function that takes multiple arguments but offers additional flexibility.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this makes it harder to parse the sentence.

@@ -1304,14 +1304,14 @@ You need to know about both to understand and navigate Nix language code.

<!-- TODO: find a place for operators -->

We recommend to at least skim them to familiarise yourself with what is available.
We recommend to at least skim them to familiarize yourself with what is available.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we use BE.

:::

<details><summary>Detailed explanation</summary>

The example imports the Nix expression from the search path `<nixpkgs>`, and applies the resulting function to an empty attribute set `{}`.
The example imports the Nix expression from the search path `<nixpkgs>` and applies the resulting function to an empty attribute set `{}`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sequence, not parallel. I'm not super strong on English grammar and placing commas, but removing that one feels it would distort the meaning.

@@ -1804,16 +1804,16 @@ Explanation:

To get things done:

- [](declarative-reproducible-envs) – create reproducible shell environments from a Nix file
- [Declarative and reproducible developer environments](declarative-reproducible-envs) – create reproducible shell environments from a Nix file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title will be filled automatically.

Comment on lines +1815 to +1816
- the data type of a named value or function argument,
- the data type a called function accepts for its argument, or
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required grammatically and makes the list harder to parse for no good reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants