[Nix-dev] Multiple instances - detecting resource collisions -nixos module system question

Michael Raskin 7c6f434c at mail.ru
Mon Jan 19 07:11:07 CET 2015


>My prediction: This will cause more headaches than it will save.

I tried to predict a headache it would cause if implemented
minimalistically and failed. Could you elaborate?

I think it could work as a reminder about typos for simple-but-large
configurations.

>> If you use multiple apaches/nginx/mysql/postgresql/whatever instances
>> its likely to miss adjusting the port or whatsoever. Therefore I'd like
>> to implement a simple "resource tracking" module which fails if a
>> resource such as tcp/ip port or socket or such gets used multiple times.
>> 
>> It should look like this: http://dpaste.com/10RKJSQ
>> 
>> 
>> A test like this:
>>       resources.tcp-ports."80" = {};
>> 
>> causes:
>>  The option `resources.tcp-ports.80.allowCollisions' defined in `/etc/nixos/nixpkgs/nixos/modules/misc/resources.nix' does not exist.
>> 
>> which I don't get because the dpaste sets a default value for
>> allowCollisions.
>> 
>> Thus does anybody just spot what I'm doing wrong?
>> 
>> If we are at it: Eelco Dolstra proposed "services.mysql.services" or
>> such. What about services.mysqls ? We could deprecade services.mysql
>> then and ask users to switch slowly. No naming collisions. Naming is
>> short and could be adopted to other services.





More information about the nix-dev mailing list