[Nix-dev] system option summary for fix-style branch? __FILE__ ?

Nicolas Pierron nicolas.b.pierron at gmail.com
Sun Mar 8 10:32:13 CET 2009


Hi Marc,

On Sun, Mar 8, 2009 at 03:26, Marc Weber <marco-oweber at gmx.de> wrote:
> So how should this new list of system option look like?
>
> man configuration.nix ? :-)

I like this idea even if all options should not be showed to
beginners. (So I agree, but we will have to split it by category one
day)

> I think a man page beeing autogenerated on nixos-rebuild would be a nice
> solution.

Yes, there is still an issue on the generation of option which is that
embedded options does not show up in manual.

> Even when we have that list we may want to edit one of those files.
> Would it be convinient to add the file containing the option to the
> option itself ?

This is more useful for person hacking NixOS but this should not be
showed to beginners.  On the other hand this information should not be
registered by hand because we don't want to maintain something which
can be generated.

There is a way to extract this information from the description field
of each option.  Each attribute has a position property and we should
extract this information to get the file name containing the option
definition.  If we introduce a new primary operation to get the
defining file of an attribute we could also get more verbosity inside
NixOS which is currently erasing all position information (due to the
evaluation mechanism)

> It could look like this:
>
> services.showManual (/pr/gitnixdev/nixos/upstart-jobs/manual.nix:10)
> default: ..
> description: ..

nice.

> In order to implement something like this there must be a __FILE__ like
> thing. Eg its known from cpp replacing __FILE__ by the real filename.
>
> It would be trivial to implement. Maybe it does already exist and I've
> missed it?

Unfortunately this does not already exists.  What you suggest may need
extra writing in each file which is a bad idea.  I prefer the primary
operation which retrieve this existing position information located on
each attribute.  It would also be nice if we can register these
location and more useful in the NixOS case if we could register more
than one location as the merging operation does such thing.

> How do you think about this?

I like the man page idea but in the future we should think about
splitting it in multiple files.

Could the manual be converted to a man page ?

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron
- If you are doing something twice then you should try to do it once.



More information about the nix-dev mailing list