NixOS modules: Difference between revisions

imported>Tv
talk about module option incompatibilities
imported>Tv
Line 85: Line 85:
{ options, ... }: {
{ options, ... }: {
   services.nginx.virtualHosts.somehost = { /* common configuration */ }
   services.nginx.virtualHosts.somehost = { /* common configuration */ }
     // (if builtins.hasAttr "port" (builtins.head options.services.nginx.virtualHosts.type.getSubModules).submodule.option
     // (if builtins.hasAttr "port" (builtins.head options.services.nginx.virtualHosts.type.getSubModules).submodule.options
           then { port = 8000; }
           then { port = 8000; }
           else { listen = [ { addr = "0.0.0.0"; port = 8000; } ]; });
           else { listen = [ { addr = "0.0.0.0"; port = 8000; } ]; });
}
}
</syntaxhighlight>
</syntaxhighlight>
 


== References ==
== References ==