NixOS modules: Difference between revisions

imported>Milahu
add section modulesPath
imported>Montchr
Replace example of obsolete `require` option with `imports`
Line 27: Line 27:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
{
{
   require = [
   imports = [
     # paths to other modules
     # paths to other modules
  ./module.nix
    ./module.nix
  /path/to/absolute/module.nix
    /path/to/absolute/module.nix
   ];
   ];


Line 37: Line 37:
</syntaxhighlight>
</syntaxhighlight>


Note: <code>require</code> is considered obsolete and there is no reason to use it anymore, however it may still linger in some legacy code. <code>imports</code> provides the same behavior.  
Note: <code>imports</code> provides the same behavior as the obsolete <code>require</code>. There is no reason to use <code>require</code> anymore, however it may still linger in some legacy code. .  


=== Function ===
=== Function ===