<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metaname="viewport"content="width=device-width, initial-scale=1.0"><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>AppendixB.NixOS Module Options</title><linkrel="stylesheet"type="text/css"href="style.css"/><scriptsrc="highlight.min.js"type="text/javascript"></script><scriptsrc="highlight.load.js"type="text/javascript"></script><metaname="generator"content="DocBook XSL Stylesheets V1.79.2"/><linkrel="home"href="index.html"title="Home Manager Manual"/><linkrel="up"href="index.html"title="Home Manager Manual"/><linkrel="prev"href="options.html"title="AppendixA.Configuration Options"/><linkrel="next"href="nix-darwin-options.html"title="AppendixC.nix-darwin Module Options"/></head><body><divclass="navheader"><tablewidth="100%"summary="Navigation header"><tr><thcolspan="3"align="center">AppendixB.NixOS Module Options</th></tr><tr><tdwidth="20%"align="left"><aaccesskey="p"href="options.html">Prev</a></td><thwidth="60%"align="center"></th><tdwidth="20%"align="right"><aaccesskey="n"href="nix-darwin-options.html">Next</a></td></tr></table><hr/></div><divclass="appendix"><divclass="titlepage"><div><div><h1class="title"><aid="ch-nixos-options"></a>AppendixB.NixOS Module Options</h1></div></div></div><divclass="variablelist"><aid="nixos-options"></a><dlclass="variablelist"><dt><spanclass="term"><aid="nixos-opt-_module.args"></a><aclass="term"href="nixos-options.html#nixos-opt-_module.args"><codeclass="option">_module.args</code></a></span></dt><dd><pclass="simpara">Additional arguments passed to each module in addition to ones
like <codeclass="literal">lib</code>, <codeclass="literal">config</code>,
and <codeclass="literal">pkgs</code>, <codeclass="literal">modulesPath</code>.</p><pclass="simpara">This option is also available to all submodules. Submodules do not
inherit args from their parent module, nor do they provide args to
their parent module or sibling submodules. The sole exception to
this is the argument <codeclass="literal">name</code> which is provided by
parent modules to a submodule and contains the attribute name
the submodule is bound to, or a unique generated name if it is
not bound to an attribute.</p><pclass="simpara">Some arguments are already passed by default, of which the
following <spanclass="emphasis"><em>cannot</em></span> be changed with this option:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><codeclass="varname">lib</code>: The nixpkgs library.</li><liclass="listitem"><codeclass="varname">config</code>: The results of all options after merging the values from all modules together.</li><liclass="listitem"><codeclass="varname">options</code>: The options declared in all modules.</li><liclass="listitem"><codeclass="varname">specialArgs</code>: The <codeclass="literal">specialArgs</code> argument passed to <codeclass="literal">evalModules</code>.</li><liclass="listitem"><pclass="simpara">All attributes of <codeclass="varname">specialArgs</code></p><pclass="simpara">Whereas option values can generally depend on other option values
thanks to laziness, this does not apply to <codeclass="literal">imports</code>, which
must be computed statically before anything else.</p><pclass="simpara">For this reason, callers of the module system can provide <codeclass="literal">specialArgs</code>
which are available during import resolution.</p><pclass="simpara">For NixOS, <codeclass="literal">specialArgs</code> includes
<codeclass="varname">modulesPath</code>, which allows you to import
extra modules from the nixpkgs package tree without having to
somehow make the module aware of the location of the
<codeclass="literal">nixpkgs</code> or NixOS directories.</p><preclass="programlisting">
{ modulesPath, ... }: {
imports = [
(modulesPath + "/profiles/minimal.nix")
];
}
</pre></li></ul></div><pclass="simpara">For NixOS, the default value for this option includes at least this argument:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><p><codeclass="varname">pkgs</code>: The nixpkgs package set according to
the <codeclass="option">nixpkgs.pkgs</code> option.</p></li></ul></div><p><spanclass="emphasis"><em>Type:</em></span> lazy attribute set of raw value</p><p><spanclass="emphasis"><em>Declared by:</em></span></p><tableborder="0"summary="Simple list"class="simplelist"><tr><td><codeclass="filename"><aclass="filename"href="https://github.com/nix-community/home-manager/blob/master/lib/modules.nix#blob-path"target="_top">
</a></code></td></tr></table></dd><dt><spanclass="term"><aid="nixos-opt-home-manager.backupFileExtension"></a><aclass="term"href="nixos-options.html#nixos-opt-home-manager.backupFileExtension"><codeclass="option">home-manager.backupFileExtension</code></a></span></dt><dd><p>On activation move existing files by appending the given
file extension rather than exiting with an error.</p><p><spanclass="emphasis"><em>Type:</em></span> null or string</p><p><spanclass="emphasis"><em>Default:</em></span><codeclass="literal">null</code></p><p><spanclass="emphasis"><em>Example:</em></span><codeclass="literal">"backup"</code></p><p><spanclass="emphasis"><em>Declared by:</em></span></p><tableborder="0"summary="Simple list"class="simplelist"><tr><td><codeclass="filename"><aclass="filename"href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path"target="_top">
</a></code></td></tr></table></dd><dt><spanclass="term"><aid="nixos-opt-home-manager.extraSpecialArgs"></a><aclass="term"href="nixos-options.html#nixos-opt-home-manager.extraSpecialArgs"><codeclass="option">home-manager.extraSpecialArgs</code></a></span></dt><dd><p>Extra <codeclass="literal">specialArgs</code> passed to Home Manager. This
option can be used to pass additional arguments to all modules.</p><p><spanclass="emphasis"><em>Type:</em></span> attribute set</p><p><spanclass="emphasis"><em>Default:</em></span><codeclass="literal">{ }</code></p><p><spanclass="emphasis"><em>Example:</em></span><codeclass="literal">{ inherit emacs-overlay; }</code></p><p><spanclass="emphasis"><em>Declared by:</em></span></p><tableborder="0"summary="Simple list"class="simplelist"><tr><td><codeclass="filename"><aclass="filename"href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path"target="_top">
</a></code></td></tr></table></dd><dt><spanclass="term"><aid="nixos-opt-home-manager.sharedModules"></a><aclass="term"href="nixos-options.html#nixos-opt-home-manager.sharedModules"><codeclass="option">home-manager.sharedModules</code></a></span></dt><dd><p>Extra modules added to all users.</p><p><spanclass="emphasis"><em>Type:</em></span> list of raw value</p><p><spanclass="emphasis"><em>Default:</em></span><codeclass="literal">[ ]</code></p><p><spanclass="emphasis"><em>Example:</em></span><codeclass="literal">[ { home.packages = [ nixpkgs-fmt ]; } ]</code></p><p><spanclass="emphasis"><em>Declared by:</em></span></p><tableborder="0"summary="Simple list"class="simplelist"><tr><td><codeclass="filename"><aclass="filename"href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path"target="_top">
</a></code></td></tr></table></dd><dt><spanclass="term"><aid="nixos-opt-home-manager.useGlobalPkgs"></a><aclass="term"href="nixos-options.html#nixos-opt-home-manager.useGlobalPkgs"><codeclass="option">home-manager.useGlobalPkgs</code></a></span></dt><dd><p>Whether to enable using the system configuration's <codeclass="literal">pkgs</code>
argument in Home Manager. This disables the Home Manager
</a></code></td></tr></table></dd><dt><spanclass="term"><aid="nixos-opt-home-manager.useUserPackages"></a><aclass="term"href="nixos-options.html#nixos-opt-home-manager.useUserPackages"><codeclass="option">home-manager.useUserPackages</code></a></span></dt><dd><p>Whether to enable installation of user packages through the
</a></code></td></tr></table></dd><dt><spanclass="term"><aid="nixos-opt-home-manager.users"></a><aclass="term"href="nixos-options.html#nixos-opt-home-manager.users"><codeclass="option">home-manager.users</code></a></span></dt><dd><p>Per-user Home Manager configuration.</p><p><spanclass="emphasis"><em>Type:</em></span> attribute set of (Home Manager module)</p><p><spanclass="emphasis"><em>Default:</em></span><codeclass="literal">{ }</code></p><p><spanclass="emphasis"><em>Declared by:</em></span></p><tableborder="0"summary="Simple list"class="simplelist"><tr><td><codeclass="filename"><aclass="filename"href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path"target="_top">
</a></code></td></tr></table></dd><dt><spanclass="term"><aid="nixos-opt-home-manager.verbose"></a><aclass="term"href="nixos-options.html#nixos-opt-home-manager.verbose"><codeclass="option">home-manager.verbose</code></a></span></dt><dd><p>Whether to enable verbose output on activation.</p><p><spanclass="emphasis"><em>Type:</em></span> boolean</p><p><spanclass="emphasis"><em>Default:</em></span><codeclass="literal">false</code></p><p><spanclass="emphasis"><em>Example:</em></span><codeclass="literal">true</code></p><p><spanclass="emphasis"><em>Declared by:</em></span></p><tableborder="0"summary="Simple list"class="simplelist"><tr><td><codeclass="filename"><aclass="filename"href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path"target="_top">