[Nix-dev] [PATCH] Some more options to ldap.conf

Nicolas Pierron nicolas.b.pierron at gmail.com
Fri Oct 28 11:39:58 CEST 2011


Hi Rickard,

I will review your patch later, first answering your question.

On Thu, Oct 27, 2011 at 23:51, Rickard Nilsson
<rickard.nilsson at telia.com> wrote:
> A general question about patches like this one: When do you stop adding
> options the Nix way, and just throw in an "extraConfiguration" option? I
> don't have anything against adding proper options, but is there some
> guideline to follow?

The problem of adding more and more option is that we start
duplicating the option originally provided by the tool.  In fact, the
best way to proceed should be to always provide an option for
appending modifications (or sorting with mkOrder, mkHeader and
mkFooter) at the first place.  In which case the description of
option, which contains the verbatim file (or almost for password),
should describe where to find the documentation to fill it.

NixOS options are useful when you start having inter-dependencies
between options and when the same logic can be abstracted under an
option name.  Additionally, option give you the ability to override
specific parts of the configuration and not the whole configuration
file.

To make it short:
- Always start with something similar to configFile / configContent
where the documentation links to the document which explains how to
fill it.
- Add an option if you need to factor common patterns between modules.
- Add an option if you want to provide modularity (including ability
to override and order)

We cannot handle the world (yet?), so we make choices in functions of our needs.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/


More information about the nix-dev mailing list