Specialisation: Difference between revisions
No edit summary |
m It might be more intuitive to add `lib.` to the `mkDefault`-value for users copying this code. |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{Expansion|Configuration with and for GRUB could use explaining here}} | {{Expansion|Configuration with and for GRUB could use explaining here}} | ||
{{low quality|References need to use <nowiki><cite></nowiki> instead of just being numbers in brackets.}} | |||
Specialisations allow you to define variations of your system configuration. For instance, if you don't usually use GPU, you might create a base system with your GPU disabled and create a dedicated specialization with Nvidia/AMD drivers installed - later, during boot, you can choose which configuration you want to boot into this time. | Specialisations allow you to define variations of your system configuration. For instance, if you don't usually use GPU, you might create a base system with your GPU disabled and create a dedicated specialization with Nvidia/AMD drivers installed - later, during boot, you can choose which configuration you want to boot into this time. | ||
| Line 36: | 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 = false;</code> in an overwritable manner using <code>mkDefault</code> and similar [3]: <code>services.xserver.desktopManager.plasma5.enable = 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 = false;</code> in an overwritable manner using <code>mkDefault</code> and similar [3]: <code>services.xserver.desktopManager.plasma5.enable = lib.mkDefault false;</code>}} | ||
== Special case: the default non-specialized entry == | == Special case: the default non-specialized entry == | ||