diff options
Diffstat (limited to 'nixos/doc/manual/configuration/modularity.xml')
-rw-r--r-- | nixos/doc/manual/configuration/modularity.xml | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/nixos/doc/manual/configuration/modularity.xml b/nixos/doc/manual/configuration/modularity.xml index 724abd31ca4e..67bb5a47d729 100644 --- a/nixos/doc/manual/configuration/modularity.xml +++ b/nixos/doc/manual/configuration/modularity.xml @@ -129,17 +129,17 @@ nix-repl> map (x: x.hostName) config.<xref linkend="opt-services.httpd.virtualHo While abstracting your configuration, you may find it useful to generate modules using code, instead of writing files. The example below would have the same effect as importing a file which sets those options. -<screen> - { config, pkgs, ... }: +<programlisting> +{ config, pkgs, ... }: - let netConfig = { hostName }: { - networking.hostName = hostName; - networking.useDHCP = false; - }; +let netConfig = { hostName }: { + networking.hostName = hostName; + networking.useDHCP = false; +}; - in +in - { imports = [ (netConfig "nixos.localdomain") ]; } - </screen> +{ imports = [ (netConfig "nixos.localdomain") ]; } +</programlisting> </para> </section> |