!avYyleMexqjFHoqrME:nixos.org

Nix Documentation

416 Members
Discussion about documentation improvements around the Nix ecosystem81 Servers

Load older messages


SenderMessageTime
5 Dec 2023
@harsh-ps-2003-63ce2d0d6da0373984bd6022:gitter.im@harsh-ps-2003-63ce2d0d6da0373984bd6022:gitter.im left the room.06:51:41
@fricklerhandwerk:matrix.orgfricklerhandwerk

Welcome to the first year “Why?! And what if…“ deep dive!

Very briefly: historical reasons. Most of us weren’t around back then, but supposedly it was just the most straightforward way to do it. Stuff grew on top, and now it’s a system that’s hard to change without breaking lots of things.

There are discussions in the Nixpkgs Architecture Team about reworking stdenv, and Nix maintainers are talking on and off about which interfaces Nix itself should provide for that.

Generally: prototypes welcome! Just know that upstream tends to be quite conservative about such far-reaching changes because apart from requiring review they incur a maintenance cost someone has to be ready to carry, and that someone usually ends up being a very diverse group of people or no one at all. Therefore beyond just “but that’s obviously better” there is a coordination problem to be solved when it comes to changes to the core.

Here we’re more concerned with documenting what works, as it helps people to get things done right now. But it of course also exposes the warts more clearly and helps understanding what could be changed. Therefore, if you have any clarifications, please make small PRs with each of them. That makes it more likely to get each of them merged almost immediately, and those bits which need discussion (because often it’s not that simple) won’t block the ones that don’t.

09:21:22
@bzzm3r:matrix.org@bzzm3r:matrix.org
In reply to @fricklerhandwerk:matrix.org

Welcome to the first year “Why?! And what if…“ deep dive!

Very briefly: historical reasons. Most of us weren’t around back then, but supposedly it was just the most straightforward way to do it. Stuff grew on top, and now it’s a system that’s hard to change without breaking lots of things.

There are discussions in the Nixpkgs Architecture Team about reworking stdenv, and Nix maintainers are talking on and off about which interfaces Nix itself should provide for that.

Generally: prototypes welcome! Just know that upstream tends to be quite conservative about such far-reaching changes because apart from requiring review they incur a maintenance cost someone has to be ready to carry, and that someone usually ends up being a very diverse group of people or no one at all. Therefore beyond just “but that’s obviously better” there is a coordination problem to be solved when it comes to changes to the core.

Here we’re more concerned with documenting what works, as it helps people to get things done right now. But it of course also exposes the warts more clearly and helps understanding what could be changed. Therefore, if you have any clarifications, please make small PRs with each of them. That makes it more likely to get each of them merged almost immediately, and those bits which need discussion (because often it’s not that simple) won’t block the ones that don’t.

🤣 makes sense! So I'll take it as "my understanding is roughly correct", and to bring it back to documentation alone:

  1. I'll submit some small PRs to improve various small things around the parts of the stdenv docs I have just finished reading.

  2. Voicing out the above (and receiving some feedback on it) helps me make sure I'm not misunderstanding things to the point where the documentation changes are misguided.

  3. And I think I did have a misunderstanding. When I woke up today morning, I realized that: actually, stdenv does use attribute sets precisely to manage/merge environment variables.

Nix expressions don't transfer environment variables "raw" between themselves. Instead, the environment is captured within attribute sets (this is why extra attributes within the arguments passed between stdenv functions are eventually "realized" as environment variables).

Computations regarding what environment variables are ultimately needed during a derivation's build-time (or its run-time) happen with these attribute sets: for example, this is what mkShell does), while functions such as shellHook serve the role of the "functor" I was imagining: they convert these attribute sets into environment variables.

15:08:24
@bzzm3r:matrix.org@bzzm3r:matrix.org This might be worth putting into the docs in one or two lines? My brain was roughly getting this message, but I didn't fully "realize" it until I had some sleep, and I think (if I am correct, I might still not be) that it might be a useful way to understand what all the mechanisms in stdenv around dependencies are ultimately doing. 15:11:17
@bzzm3r:matrix.org@bzzm3r:matrix.org (It has, for me at least, been very helpful in understanding what mkShell does, so that I can write my own derivation that is less bash-focused, as Rob suggests in the SO answer I linked before: https://stackoverflow.com/questions/71016402/how-to-start-a-zsh-shell-session-with-additional-non-permanent-aliases/71112117#71112117) 15:13:16
@bzzm3r:matrix.org@bzzm3r:matrix.org * (It has, for me at least, been very helpful in understanding what mkShell does, so that I can write my own derivation that is less bash-focused, as Rob suggests in the SO answer I linked before: https://stackoverflow.com/questions/71016402/how-to-start-a-zsh-shell-session-with-additional-non-permanent-aliases/71112117#71112117) (Side-benefit: I don't have to use direnv. I could probably submit this little project as a guide/recipe on nix.dev...) 15:14:05
@bzzm3r:matrix.org@bzzm3r:matrix.org * (It has, for me at least, been very helpful in understanding what mkShell does, so that I can write my own derivation that is less bash-focused, as Rob suggests in the SO answer I linked before: https://stackoverflow.com/questions/71016402/how-to-start-a-zsh-shell-session-with-additional-non-permanent-aliases/71112117#71112117) (Side-benefit: I don't have to use direnv. I could probably submit this little project---once completed---as a guide/recipe on nix.dev...) 15:14:31
@bzzm3r:matrix.org@bzzm3r:matrix.org
In reply to @bzzm3r:matrix.org

🤣 makes sense! So I'll take it as "my understanding is roughly correct", and to bring it back to documentation alone:

  1. I'll submit some small PRs to improve various small things around the parts of the stdenv docs I have just finished reading.

  2. Voicing out the above (and receiving some feedback on it) helps me make sure I'm not misunderstanding things to the point where the documentation changes are misguided.

  3. And I think I did have a misunderstanding. When I woke up today morning, I realized that: actually, stdenv does use attribute sets precisely to manage/merge environment variables.

Nix expressions don't transfer environment variables "raw" between themselves. Instead, the environment is captured within attribute sets (this is why extra attributes within the arguments passed between stdenv functions are eventually "realized" as environment variables).

Computations regarding what environment variables are ultimately needed during a derivation's build-time (or its run-time) happen with these attribute sets: for example, this is what mkShell does), while functions such as shellHook serve the role of the "functor" I was imagining: they convert these attribute sets into environment variables.

(it would also be helpful to know: when we are thinking about a NixOS system environment, rather than a temporary shell's environmet, when is the system environment refreshed with information from these expressions? is it only upon rebuild? I think so, because NixOS has no "run-time" mechanisms (e.g. systemd units) to update env vars based on the declarative setup?)
18:43:59
@ibizaman:matrix.orgibizaman

Hi everyone. Thank you for all your efforts on the nix documentation. It is really a treasure trove of information that I use just about all the time.

I tried using `nixos-render-docs` on my project’s manual. I was lured away from nvmd thanks to this new tool able to parse markdown files instead. But then I stumbled into a few issues. One is about embedding pictures from nested directories. I’ll create an issue and test and PR soon about that one.

I did create an issue about the main blocking one for me https://github.com/NixOS/nixpkgs/issues/272329.

I just started looking at that tool’s code and it’s still not obvious to me how all works together to create html files. But if you deem solving this issue in the tool worth it, I’m happy to invest some time on this.  

19:26:11
@infinisil:matrix.orginfinisilI pinged the relevant people in the issue :)19:53:11
@fricklerhandwerk:matrix.orgfricklerhandwerk
In reply to @bzzm3r:matrix.org
(It has, for me at least, been very helpful in understanding what mkShell does, so that I can write my own derivation that is less bash-focused, as Rob suggests in the SO answer I linked before: https://stackoverflow.com/questions/71016402/how-to-start-a-zsh-shell-session-with-additional-non-permanent-aliases/71112117#71112117) (Side-benefit: I don't have to use direnv. I could probably submit this little project---once completed---as a guide/recipe on nix.dev...)

Extra attributes being passed as environment variables to the builder executable is a behavior of the underlying builtins.derivation: https://nixos.org/manual/nix/unstable/language/derivations#builder-execution

And while mkShell is quite magical, it essentially is also just a wrapper around the undocumented buildEnv.

20:02:19
@fricklerhandwerk:matrix.orgfricklerhandwerkAll that surely needs more clarification, but once you get it, it’s not that complicated. I found it fruitful discussing what you understand so far in PRs making these clarifications in documentation. If you have some stamina, everyone will benefit: you’ll learn directly from maintainers how it works, maintainers will learn where the pain points are, and together we’ll make sure it’s correct and unambiguous.20:04:19
6 Dec 2023
@bzzm3r:matrix.org@bzzm3r:matrix.orgSounds good, yeah, I'll start up that sequence of PRs soon!02:51:02
@bzzm3r:matrix.org@bzzm3r:matrix.org In the meantime, the continuation of proofconstruction's PR from August is now ready to be reviewed! 02:51:26
@bzzm3r:matrix.org@bzzm3r:matrix.orghttps://github.com/NixOS/nix.dev/pull/83102:51:27
@philiptaron:matrix.orgPhilip Taron (UTC-8) joined the room.04:52:55
7 Dec 2023
@proofconstruction:matrix.orgproofconstructionWill take a look this afternoon, thanks!15:51:27
@ibizaman:matrix.orgibizaman
In reply to @ibizaman:matrix.org

Hi everyone. Thank you for all your efforts on the nix documentation. It is really a treasure trove of information that I use just about all the time.

I tried using `nixos-render-docs` on my project’s manual. I was lured away from nvmd thanks to this new tool able to parse markdown files instead. But then I stumbled into a few issues. One is about embedding pictures from nested directories. I’ll create an issue and test and PR soon about that one.

I did create an issue about the main blocking one for me https://github.com/NixOS/nixpkgs/issues/272329.

I just started looking at that tool’s code and it’s still not obvious to me how all works together to create html files. But if you deem solving this issue in the tool worth it, I’m happy to invest some time on this.  

Happy to report my issue is resolved! <3
19:20:27
8 Dec 2023
@9999years:matrix.org@9999years:matrix.org joined the room.19:55:35
9 Dec 2023
@lennart:0520.chlennart (this account will be deactivated by 1st of may 2025) joined the room.19:24:12
@git_lit_mit_ohne_dir:matrix.org@git_lit_mit_ohne_dir:matrix.org joined the room.20:43:08
@bzzm3r:matrix.org@bzzm3r:matrix.org infinisil: it seems that getting a google API key requires entering credit card information 21:09:32
@bzzm3r:matrix.org@bzzm3r:matrix.orghttps://nix.dev/tutorials/module-system/module-system21:09:33
@bzzm3r:matrix.org@bzzm3r:matrix.org * infinisil: it seems that getting a google API key requires entering credit card information, which makes it not so easy to follow along with this: 21:09:49
@bzzm3r:matrix.org@bzzm3r:matrix.org what i'll do for now to follow the tutorial is change the map/geocode scripts so that they emit dummy information to stdout, rather than make actual API calls 21:10:32
@git_lit_mit_ohne_dir:matrix.org@git_lit_mit_ohne_dir:matrix.org left the room.21:45:36
10 Dec 2023
@infinisil:matrix.orginfinisil
In reply to @bzzm3r:matrix.org
infinisil: it seems that getting a google API key requires entering credit card information, which makes it not so easy to follow along with this:
bzm3r: Yeah it sucks a lot. We didn't have the resources to rewrite it into something more open
00:11:39
@infinisil:matrix.orginfinisil
In reply to @bzzm3r:matrix.org
what i'll do for now to follow the tutorial is change the map/geocode scripts so that they emit dummy information to stdout, rather than make actual API calls
Yeah that works too, ideally the tutorial would be adapted to a more open mapping api
00:12:35
@bzzm3r:matrix.org@bzzm3r:matrix.org
In reply to @infinisil:matrix.org
bzm3r: Yeah it sucks a lot. We didn't have the resources to rewrite it into something more open

no worries at all, I'll submit a PR if I can something simpler.

I don't know much about open map APIs, so I want to be careful about not opening up another rabbithole...is there one that you recommend?

02:34:49
@bzzm3r:matrix.org@bzzm3r:matrix.org
In reply to @infinisil:matrix.org
bzm3r: Yeah it sucks a lot. We didn't have the resources to rewrite it into something more open
*

no worries at all, I'll submit a PR if I can determine something simpler.

I don't know much about open map APIs, so I want to be careful about not opening up another rabbithole...is there one that you recommend?

02:35:01

Show newer messages


Back to Room ListRoom Version: 6