[Nix-dev] Re: [Nix-commits] SVN commit: nix - 20576 - ludo - in nixos/trunk/modules: . config

Nicolas Pierron nicolas.b.pierron at gmail.com
Fri Mar 12 09:40:09 CET 2010


2010/3/12 Ludovic Courtès <ludo at gnu.org>:
> Hi again,
>
> Nicolas Pierron
> <nicolas.b.pierron at gmail.com> writes:
>
>> Unfortunately this won't work.  As I've explained at the Fosdem,
>>
>> services.xserver.startOpenSSHAgent = false;
>>
>> does not forbid the user to use it, but
>>
>> services.xserver.startGnuPGAgent = true;
>>
>> does.
>>
>> So you don't want to enable the Gnu versions.
>
> Now I understand what you mean: merging boolean values consists in
> or’ing them.  So if the option is defined at least once as ‘true’, then
> its final value is ‘true’ and the user cannot change it.
>
>> You want to take precedence over user configuration, in which case I
>> recommend you to use mkOverride, but you don't want to force user to
>> use all tools.  So you cannot write '' whatever = true; ''.  You can
>> only disable non-GNU tools like:
>>
>> services.xserver.startOpenSSHAgent = mkOverride 0 {} false;
>>
>> In which case nothing can enable it excepts another "mkOverride 0" (or less).
>
> OK.

>> What you are seeking is something which is similar to the rename
>> except that it force the other enable flags to be bound to false.
>> Unfortunately this may be more complicated but it will ensure that you
>> won't get any non-GNU programs even if you want it.
>
> Hmm, but if I explicitly ask for non-GNU programs in
> ‘configuration.nix’, I still want this choice to have higher precedence
> than ‘gnu.nix’...
>

If you don't want to force the user to not using openssh or any other,
then you can specify a value between [ 0 .. 100 [, 100 is the value of
any option definition and over is reserved for default values.  like
mkDefaultValue does.



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



More information about the nix-dev mailing list