NixOS / nix.dev

Official documentation for getting things done with Nix.
https://nix.dev
Creative Commons Attribution Share Alike 4.0 International
2.59k stars 252 forks source link

Expand and improve the Module System tutorial #966

Open djacu opened 6 months ago

djacu commented 6 months ago

Hey @NixOS/documentation-team

Observations I've already chatted with @fricklerhandwerk and @infinisil about improving the module system deep dive article. I've written quite a bit of material for a workshop I gave at NixCon NA this year and I it is worth migrating to nix.dev.

Problem The current module system deep dive is:

Approaches As mentioned, I presented a workshop on the module system. To prepare for that, I created my own set of lessons and a website to host them (https://nixos-modules.nix.みんな/).

Each lesson is:

My plan for migration is as follows:

  1. We agree this is a good idea!
  2. Migrate the first lesson (https://nixos-modules.nix.みんな/lessons/a-basic-module/lesson/)
  3. We migrate the infra so that lessons are verified to work at build time. If this is something we want to take on.
  4. Migrate the remaining lessons.
  5. Modify the current deep dive. There is a lot of overlap between my lessons and the deep dive. If these lessons are migrated, we can cut back on the earlier sections of the deep dive and focus on the unique aspects of it.
  6. Add more lessons. What I have is not comprehensive and is just sufficient to get someone started on the module system. There is much more to explain and document.

Willing to help? Yes

Priorities

Add :+1: to issues you find important.

nixos-discourse commented 6 months ago

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

https://discourse.nixos.org/t/2024-04-25-documentation-team-meeting-notes-122/44080/1

autra commented 6 months ago

Sounds really nice! I had started to rewrite the "deep dive" tuto using open services (osm mainly) but frankly, I'm not sure it is a good idea: the deep dive might be funny to follow and imo works well in a workshop, but it's not a very real packaging use case. Also I'm quite new in the nix world, and I suspect part of it are outdated (but can't really judge for sure).

I think that from a newcomer perspective (I've only started learning nix in 2024), there is a gap just before the "packaging existing software" page on nix.dev, which some of your first lessons could very well fill even before the "deep dive" page.

Add more lessons. What I have is not comprehensive and is just sufficient to get someone started on the module system. There is much more to explain and document.

Especially, nixpkgs and the library it provides is still a lot more unknown to me that nix (the language) itself. It would be nice to have some lessons about it

Anyway, if you need a guinea pig for your pull requests, don't hesitate to ping me :-)

fricklerhandwerk commented 6 months ago

Sorry for not commenting earlier, my notification queue is too long.

The infra aspect is really good and generally desirable, especially if it's somewhat transparent how it works and thus easy to maintain or create new samples.

Concerning the migration or merging of contents, I think it's a very good idea because the deep dive has a couple structural issues. I'm just a bit skeptical how exactly to approach such a lengthy and review-intensive process such that we won't have two construction sites next to each other for an indefinite amount of time.

One of my primary goals is for nix.dev to be small but authoritative (in the sense of "exactly one, working solution to each problem"), which kind of precludes showing essentially equivalent alternatives. I know, we're not very far with that. @djacu maybe you drop into one of the office hours and we figure out how to move forward in a high bandwidth conversation?

djacu commented 6 months ago

@fricklerhandwerk my idea for merging was to leave the current deep dive alone until we had a decent amount of content migrated. There are definitely a lot more details to work out so I'll try to be at the Thursday meeting. That's what you meant by office hours, right?

nixos-discourse commented 6 months ago

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

https://discourse.nixos.org/t/2024-05-16-documentation-team-meeting-notes-128/45537/1