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

flakes tutorial #242

Closed
wants to merge 16 commits into from
Closed

flakes tutorial #242

wants to merge 16 commits into from

Conversation

mhwombat
Copy link

Perhaps this tutorial would be useful to others. Comments and criticisms are welcome.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 16, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@mhwombat
Copy link
Author

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

@mhwombat
Copy link
Author

recheck

github-actions bot added a commit that referenced this pull request Mar 16, 2022
@zupo
Copy link
Contributor

zupo commented May 1, 2022

I'm a complete flake n00b. This is a good read, but it needs to go further:

  • I'd like to see a few full examples of stuff I can do with flakes. Complete hand-holding, just copy-paste in my terminal and it works. Then I can tweak and play with it to learn.
  • I'm using a stable nixpkgs channel and flakes don't seem to be supported/enabled?

@mkroehnert
Copy link

@zupo the following blog post series by @Xe might also be interesting to you: https://christine.website/blog/series/nix-flakes

@mhwombat might also be a good link to add to the "Other Resources" section.

mhwombat and others added 2 commits May 2, 2022 17:34
Co-authored-by: Neyts Zupan <nejc.zupan@gmail.com>
@mhwombat
Copy link
Author

mhwombat commented May 2, 2022

@mhwombat might also be a good link to add to the "Other Resources" section.

Done

mhwombat and others added 2 commits August 11, 2022 01:28
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
defaultPackage."<system>" = derivation;
```

`<system>` is something like "x86_64-linux", "aarch64-linux", "i686-linux", or "x86_64-darwin".
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we now have this twice, maybe add a section just for that and link to it in both cases? Or make it the same shape.

Comment on lines +126 to +127
This is used by `nixos-rebuild --flake .#<hostname>`
`nixosConfigurations."<hostname>".config.system.build.toplevel`
Copy link
Collaborator

@fricklerhandwerk fricklerhandwerk Aug 11, 2022

Choose a reason for hiding this comment

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

I don't understand this, what do the two samples mean?

@fricklerhandwerk
Copy link
Collaborator

fricklerhandwerk commented Aug 11, 2022

This is really good and only needs polishing. Thank you!

A few general points:

We still need a section showing how to enable flakes. I updated the NixOS Wiki article - we could link to it or copy it verbatim.

While we haven't decided on this yet, I strongly suggest wrapping lines at sentence boundaries.

All of the things I commented on also hold true for the Wiki article. In addition, we have to reduce redundancy to avoid confusing people with overlapping (and worst: inconsistent) information. Therefore it would be awesome if you could take care of the article after this PR is merged, and update it in the same vein: link to this tutorial, remove redundant sections and additional resources. Possibly, if you want to take the time, add information from the external resources so we can eventually centralize all that knowledge.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
mhwombat and others added 10 commits August 11, 2022 03:35
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
@fricklerhandwerk fricklerhandwerk changed the title added flake tutorial flakes tutorial Sep 9, 2022
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/usability-study-session-2/21400/1

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/usability-study-session-1/21398/1

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/usability-study-session-4/21422/1

@ghost
Copy link

ghost commented Oct 3, 2022

I would greatly appreciate using this tutorial. Thanks for leading the charge into teaching flakes on nix.dev @mhwombat !

@zmitchell
Copy link
Contributor

@fricklerhandwerk should we close this since we aren't documenting flakes?

@fricklerhandwerk
Copy link
Collaborator

I agree we should close this, but not only because we're not putting dedicated effort into documenting experimental features, but because we should approach this differently. In it's current form the diff to the reference documentation is minimal, and the value added here could be folded into the Nix manual.

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