srid / nixos-flake

A flake-parts module to manage NixOS and macOS machines, along with home-manager support, in a unified fashion.
https://community.flake.parts/nixos-flake
MIT License
175 stars 19 forks source link

docs: How to use? #25

Open woile opened 1 year ago

woile commented 1 year ago

Thanks for this amazing project. I think it's exactly what I've been looking for 💪🏻

I was wondering if some documentation could be added explaining how to use it. Similar to this explanation: https://github.com/srid/nixos-config#setup

And also an explanation of what would happen next, does a user have to run nix run every time?
How to remove afterwards?

Thanks!

srid commented 1 year ago

Yea, we definitely should flesh out docs. Contributions welcome! Is there anything to be added to https://zero-to-flakes.com/nixos-flake/start to begin with?

For home-manager, we can adapt the asciicast in https://github.com/juspay/nix-dev-home

woile commented 1 year ago

I mentioned the link to the setup because I couldn't find which command to run in the docs. For a beginner it's not clear which flake command would modify the os. I can add this in a PR and discuss it there.

I would also add a brief explanation about how home-manager and nix-darwin modify the host, as a beginner for example I wonder: is it gonna delete some important files? Am I gonna be able to revert these changes?

srid commented 1 year ago

Yes, the /start page can certainly be improved. It looks like you are using macOS, so the third step is detailed in the paragraph below the table of the page it links to:

image
woile commented 1 year ago

I had not seen this, thanks! I was thinking maybe we can restructure the content in a more concise way (I can submit a PR if desired):

## Installation
nix install...

## Getting started
Running and adjusting template

## Usage
`nix run .#activate` ...

## Module outptus

btw your work has given me hope in nix again, amazing tools 💪🏻 thanks!

srid commented 1 year ago

@woile Yes, I'd absolutely love a PR on that!

The docs are being deployed here: https://zero-to-flakes.com/nixos-flake/

So the best way to contribute is to

  1. Clone https://github.com/juspay/zero-to-flakes
  2. Pull the submodules
  3. Run , run just run in the nix shell
  4. Edit ./ext/nixos-flake - and the preview should update

(I'll have to document this in detail somewhere)

woile commented 1 year ago

I've cloned the repo and submodules with:

git submodule update --init --recursive

but I don't understand, shouldn't I send a PR to nixos-flake instead?

srid commented 1 year ago

Sorry, I didn't see this comment until now.

The full instructions are here: https://zero-to-flakes.com/about#contributing

shouldn't I send a PR to nixos-flake instead?

You edit the docs from zero-to-flakes repo, but commit and PR on nixos-flake, yes.

srid commented 1 month ago

Note to self: one thing we should document is the much-useful flake argument, and provide examples: like how to access external flakes in one's config:

https://github.com/srid/nixos-config/blob/32de95896d7e5f6346634636f536df5dbc845d34/packages/overlay.nix#L12