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

Marc Weber marco-oweber at gmx.de
Wed Jan 14 23:17:16 CET 2015


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.

Marc Weber


More information about the nix-dev mailing list