NixOS: Difference between revisions
imported>Ixxie |
imported>Ixxie Styling of the code boxes in the modules section: moved out the file names. |
||
Line 150: | Line 150: | ||
The NixOS module system implements a typing system which allows typechecking of option settings. It also enables options defined in multiple places to be merged automatically. This allows you to spread your configuration over multiple files, and the options you set across all of those files will be merged together: | The NixOS module system implements a typing system which allows typechecking of option settings. It also enables options defined in multiple places to be merged automatically. This allows you to spread your configuration over multiple files, and the options you set across all of those files will be merged together: | ||
<code>/etc/nixos/configuration.nix</code>: | |||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
{ | { | ||
imports = [ | imports = [ | ||
Line 159: | Line 159: | ||
} | } | ||
</syntaxHighlight> | </syntaxHighlight> | ||
<code>/etc/nixos/basic-webserver.nix</code>: | |||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
{ | { | ||
services.nginx.enable = true; | services.nginx.enable = true; | ||
Line 168: | Line 168: | ||
} | } | ||
</syntaxHighlight> | </syntaxHighlight> | ||
<code>/etc/nixos/blog.nix</code>: | |||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
{ | { | ||
services.nginx.virtualHosts."blog.example.com" = { | services.nginx.virtualHosts."blog.example.com" = { |