Skip to content

Move documentation for impure derivation#8212

Open
bryanhonof wants to merge 6 commits intoNixOS:masterfrom
bryanhonof:impure-derivation-docs
Open

Move documentation for impure derivation#8212
bryanhonof wants to merge 6 commits intoNixOS:masterfrom
bryanhonof:impure-derivation-docs

Conversation

@bryanhonof
Copy link
Member

Motivation

The documentation of impure derivations was only available under the experimental features section. The feature adds an attribute to derivation, so I thought it made sense to also document it under the special attributes section.

Context

Be more consistent with documenting the attributes available to derivation.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • documentation in the internal API docs
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 👍 to pull requests you find important.

.gitignore Outdated
/doc/manual/src/command-ref/new-cli
/doc/manual/src/command-ref/conf-file.md
/doc/manual/src/command-ref/experimental-features-shortlist.md
/doc/manual/src/contributing/experimental-feature-descriptions.md
Copy link
Member Author

@bryanhonof bryanhonof Apr 12, 2023

Choose a reason for hiding this comment

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

This got added in #7798, although I'm not certain how we'd update the description of experimental features then?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, never mind… it is generated. 😁

@nicepc
Copy link

nicepc commented Apr 12, 2023 via email

@bryanhonof bryanhonof force-pushed the impure-derivation-docs branch from a101940 to 7354cc9 Compare April 12, 2023 18:22
@Ericson2314
Copy link
Member

Ericson2314 commented Apr 13, 2023

Good idea!

In #8174 I tried to start doing a consistent style for this sort of thing. Whatever we end up with, it would be good to match that with this.

Copy link
Contributor

@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.

Please let's format markdown with one line per sentence, it makes review a lot easier and minimizes the diff when working on contents.

I agree with @edolstra that the additional information should end up here, but in its current shape it appears to me that it will do more harm than good because it adds so many concepts without any hint at what they actually mean.

In scope of my self-assigned crusade to reduce the potential for confusion in Nix documentation, I think these parts should be left for a follow up, which will probably be non-trivial.

to the embedded store and not to the host's Nix store.

- [`__impure`]{#adv-attr-__impure}\
> **Warning**
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation is broken again

```

Each time this derivation is built it produces a different output,
since the builder outputs random bytes to $out. The [pull request
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
since the builder outputs random bytes to $out. The [pull request
since the builder outputs random bytes to `$out`. The [pull request

Each time this derivation is built it produces a different output,
since the builder outputs random bytes to $out. The [pull request
introducing impure
derivations](https://github.com/NixOS/nix/pull/6227) has more
Copy link
Contributor

Choose a reason for hiding this comment

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

No, please inline the examples here. PRs cannot be maintained.

Impure derivations have the following traits:
- Only impure or fixed-output derivations are allowed to depend on
impure derivations directly. "Pure" (i.e. input-addressed or
floating CA derivations) can depend on impure derivations
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use abbreviations of our own terms, they have to be expected to be not known to readers.

Suggested change
floating CA derivations) can depend on impure derivations
floating content-addressed derivations) can depend on impure derivations

Is floating CA defined anywhere? Otherwise this adds more confusion than it removes because readers will tend to either not actually understand anything at all or go on a tour through the internet searching for an explanation of those terms, complaining why everything is so scattered.

barrier" in the dependency graph.
- They cannot be
[content-addressed](@docroot@/contributing/experimental-features.md#xp-feature-ca-derivations)
- Impure derivations are not "cached". Thus, running "nix-build"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is cached put in quotes? Is it only quasi caching? What does caching mean here exactly?

Suggested change
- Impure derivations are not "cached". Thus, running "nix-build"
- Impure derivations are not cached, that is, <answer that question>. Thus, running `nix-build`

time.
- They are implemented similar to CA derivations, i.e. the output
is moved to a content-addressed path in the store. The
difference is that we don't register a realisation in the Nix database.
Copy link
Contributor

Choose a reason for hiding this comment

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

CA Realisation is not a defined term in the manual. There is even an issue for that. Given that Realisation means something else with an existing definition, using it here will only lead to confusion.

I don't want to blow up the scope here, but I think referring to non-trivial concepts which are nowhere defined or explained is a net detriment, and for me that constitutes a blocker that has to be resolved first. I suggest that you this part out for now and open an issue to follow up (ideally with all the information that you already had, so it can be picked up by someone easily). @NixOS/documentation-team could help disentangling the tasks that have to be done in order to document these details properly.

- They are implemented similar to CA derivations, i.e. the output
is moved to a content-addressed path in the store. The
difference is that we don't register a realisation in the Nix database.
- When sandboxing is enabled, impure derivations can access the
Copy link
Contributor

Choose a reason for hiding this comment

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

Please link to the associated configuration setting

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-47/27387/1

infinisil added a commit to NixOS/SC-election-2024 that referenced this pull request Sep 20, 2024
Some of these are a bit after the specified time period, but I also believe some of these items are difficult to gauge how much "impact" they had.

Helped organize, host, and run, the Summer of Nix Lecture Series 2022

- https://www.youtube.com/playlist?list=PLt4-_lkyRrOMWyp5G-m_d1wtTcbBaOxZk
- NixOS/infra#213

Helped organize, and host infra for, the Summer of Nix Lecture Series 2023

- https://www.youtube.com/playlist?list=PLt4-_lkyRrOPcBuz_tjm6ZQb-6rJjU3cf
- NixOS/infra#240

Helped organize, host, and was responsible for livestreaming infra during, NixCon Paris 2022

- https://www.youtube.com/playlist?list=PLgknCdxP89ReD6gxl755B6G_CI65z4J2e

Maintenance of some nixpkgs packages

- NixOS/nixpkgs#340223 (contribution after 2024-05-01)
- NixOS/nixpkgs#290084
- NixOS/nixpkgs#170089

Organized, and assembled a team for the FOSDEM 2023 Nix/NixOS Devroom

- https://discourse.nixos.org/t/fosdem-2023-nix-and-nixos-devroom/23133

Organizer & sole maintainer of the Config Management Camp Nix track

- https://discourse.nixos.org/t/config-management-camp-2023-ghent/23455
- https://discourse.nixos.org/t/config-management-camp-2024-ghent/33852
- https://discourse.nixos.org/t/cfgmgmtcamp-2025-is-looking-for-nix-presentations/51658 (contribution after 2024-05-01)

Public speaking & spreading awareness of Nix/NixOS

- https://youtu.be/gUjvnZ9ZwMs?si=nDiZTCpQj53wwq8P
- https://www.youtube.com/watch?v=hNcYPH5Q_pA&t=862s

The occasional dabble into the Nix C++ code base

- NixOS/nix#11494 (contribution after 2024-05-01)
- NixOS/nix#11490 (contribution after 2024-05-01)
- NixOS/nix#11489 (contribution after 2024-05-01)
- NixOS/nix#11349 (contribution after 2024-05-01)
- NixOS/nix#11241 (contribution after 2024-05-01)
- NixOS/nix#9557
- NixOS/nix#8788
- NixOS/nix#8212
- NixOS/nix#5147

General evangelism

Pretty much every event I attend, I'm talking about Nix, showing off Nix/NixOS, and just trying to get people to see how awesome this tool is.
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.

6 participants