Specialisation: Difference between revisions

m lowquality
Zeal (talk | contribs)
m It might be more intuitive to add `lib.` to the `mkDefault`-value for users copying this code.
 
Line 37: Line 37:
In this example, the <code>chani</code> specialisation inherits the parent config (that contains the <code>specialisation</code> directive), but additionally activates the plasma5 desktop. The <code>paul</code> specialisation on the other hand does not <code>inheritParentConfig</code> and defines its own one from scratch instead.  
In this example, the <code>chani</code> specialisation inherits the parent config (that contains the <code>specialisation</code> directive), but additionally activates the plasma5 desktop. The <code>paul</code> specialisation on the other hand does not <code>inheritParentConfig</code> and defines its own one from scratch instead.  


{{Note|At times, you may want to overwrite values in specialisations which you have already defined in your parent configuration. To solve this problem in <code>chani</code> example, the parent configuration could define <code>services.xserver.desktopManager.plasma5.enable &#61; false;</code> in an overwritable manner using <code>mkDefault</code> and similar [3]: <code>services.xserver.desktopManager.plasma5.enable &#61; mkDefault false;</code>}}
{{Note|At times, you may want to overwrite values in specialisations which you have already defined in your parent configuration. To solve this problem in <code>chani</code> example, the parent configuration could define <code>services.xserver.desktopManager.plasma5.enable &#61; false;</code> in an overwritable manner using <code>mkDefault</code> and similar [3]: <code>services.xserver.desktopManager.plasma5.enable &#61; lib.mkDefault false;</code>}}


== Special case: the default non-specialized entry ==
== Special case: the default non-specialized entry ==