Specialisation: Difference between revisions
imported>PhilTaken fix an incorrect path to the specialisation switch |
imported from old wiki |
||
Line 40: | Line 40: | ||
{{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 = mkDefault false;</code>}} | ||
== Special case: the default non- | == Special case: the default non-specialized entry == | ||
Specializations are receiving options in addition to your default configuration, but what if you want to have options in your default configuration that shouldn't be pulled by the specializations? | |||
Use the conditional <code>config.specialisation != {}</code> to declare values for the non-specialized case. For example, you could write a module (as variable, or separate file), imported from <code>configuration.nix</code> via <code>imports = [...]</code> like this: | |||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> |