1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00
home-manager/nixos-options.html

48 lines
12 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix B. NixOS Module Options</title><link rel="stylesheet" type="text/css" href="style.css" /><script src="highlight.min.js" type="text/javascript"></script><script src="highlight.load.js" type="text/javascript"></script><meta name="generator" content="DocBook XSL Stylesheets V1.79.2" /><link rel="home" href="index.html" title="Home Manager Manual" /><link rel="up" href="index.html" title="Home Manager Manual" /><link rel="prev" href="options.html" title="Appendix A. Configuration Options" /><link rel="next" href="nix-darwin-options.html" title="Appendix C. nix-darwin Module Options" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. NixOS Module Options</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="options.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="nix-darwin-options.html">Next</a></td></tr></table><hr /></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a id="ch-nixos-options"></a>Appendix B. NixOS Module Options</h1></div></div></div><div class="variablelist"><a id="nixos-options"></a><dl class="variablelist"><dt><span class="term"><a id="nixos-opt-_module.args"></a><a class="link" href="nixos-options.html#nixos-opt-_module.args"><code class="option">_module.args</code></a></span></dt><dd><p class="simpara">Additional arguments passed to each module in addition to ones
like <code class="literal">lib</code>, <code class="literal">config</code>,
and <code class="literal">pkgs</code>, <code class="literal">modulesPath</code>.</p><p class="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 <code class="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><p class="simpara">Some arguments are already passed by default, of which the
following <span class="emphasis"><em>cannot</em></span> be changed with this option:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="varname">lib</code>: The nixpkgs library.</li><li class="listitem"><code class="varname">config</code>: The results of all options after merging the values from all modules together.</li><li class="listitem"><code class="varname">options</code>: The options declared in all modules.</li><li class="listitem"><code class="varname">specialArgs</code>: The <code class="literal">specialArgs</code> argument passed to <code class="literal">evalModules</code>.</li><li class="listitem"><p class="simpara">All attributes of <code class="varname">specialArgs</code></p><p class="simpara">Whereas option values can generally depend on other option values
thanks to laziness, this does not apply to <code class="literal">imports</code>, which
must be computed statically before anything else.</p><p class="simpara">For this reason, callers of the module system can provide <code class="literal">specialArgs</code>
which are available during import resolution.</p><p class="simpara">For NixOS, <code class="literal">specialArgs</code> includes
<code class="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
<code class="literal">nixpkgs</code> or NixOS directories.</p><pre class="programlisting">
{ modulesPath, ... }: {
imports = [
(modulesPath + "/profiles/minimal.nix")
];
}
</pre></li></ul></div><p class="simpara">For NixOS, the default value for this option includes at least this argument:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="varname">pkgs</code>: The nixpkgs package set according to
the <code class="option">nixpkgs.pkgs</code> option.</p></li></ul></div><p><span class="emphasis"><em>Type:</em></span> lazy attribute set of raw value</p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/lib/modules.nix#blob-path" target="_top">
&lt;home-manager/lib/modules.nix&gt;
</a></code></td></tr></table></dd><dt><span class="term"><a id="nixos-opt-home-manager.backupFileExtension"></a><a class="link" href="nixos-options.html#nixos-opt-home-manager.backupFileExtension"><code class="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><span class="emphasis"><em>Type:</em></span> null or string</p><p><span class="emphasis"><em>Default:</em></span> <code class="literal">null</code></p><p><span class="emphasis"><em>Example:</em></span> <code class="literal">"backup"</code></p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path" target="_top">
&lt;home-manager/nixos/common.nix&gt;
</a></code></td></tr></table></dd><dt><span class="term"><a id="nixos-opt-home-manager.extraSpecialArgs"></a><a class="link" href="nixos-options.html#nixos-opt-home-manager.extraSpecialArgs"><code class="option">home-manager.extraSpecialArgs</code></a></span></dt><dd><p>Extra <code class="literal">specialArgs</code> passed to Home Manager. This
option can be used to pass additional arguments to all modules.</p><p><span class="emphasis"><em>Type:</em></span> attribute set</p><p><span class="emphasis"><em>Default:</em></span> <code class="literal">{ }</code></p><p><span class="emphasis"><em>Example:</em></span> <code class="literal">{ inherit emacs-overlay; }</code></p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path" target="_top">
&lt;home-manager/nixos/common.nix&gt;
</a></code></td></tr></table></dd><dt><span class="term"><a id="nixos-opt-home-manager.sharedModules"></a><a class="link" href="nixos-options.html#nixos-opt-home-manager.sharedModules"><code class="option">home-manager.sharedModules</code></a></span></dt><dd><p>Extra modules added to all users.</p><p><span class="emphasis"><em>Type:</em></span> list of raw value</p><p><span class="emphasis"><em>Default:</em></span> <code class="literal">[ ]</code></p><p><span class="emphasis"><em>Example:</em></span> <code class="literal">[ { home.packages = [ nixpkgs-fmt ]; } ]</code></p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path" target="_top">
&lt;home-manager/nixos/common.nix&gt;
</a></code></td></tr></table></dd><dt><span class="term"><a id="nixos-opt-home-manager.useGlobalPkgs"></a><a class="link" href="nixos-options.html#nixos-opt-home-manager.useGlobalPkgs"><code class="option">home-manager.useGlobalPkgs</code></a></span></dt><dd><p>Whether to enable using the system configuration's <code class="literal">pkgs</code>
argument in Home Manager. This disables the Home Manager
options <code class="option">nixpkgs.*</code>
.</p><p><span class="emphasis"><em>Type:</em></span> boolean</p><p><span class="emphasis"><em>Default:</em></span> <code class="literal">false</code></p><p><span class="emphasis"><em>Example:</em></span> <code class="literal">true</code></p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path" target="_top">
&lt;home-manager/nixos/common.nix&gt;
</a></code></td></tr></table></dd><dt><span class="term"><a id="nixos-opt-home-manager.useUserPackages"></a><a class="link" href="nixos-options.html#nixos-opt-home-manager.useUserPackages"><code class="option">home-manager.useUserPackages</code></a></span></dt><dd><p>Whether to enable installation of user packages through the
<code class="option">users.users.&lt;name&gt;.packages</code> option
.</p><p><span class="emphasis"><em>Type:</em></span> boolean</p><p><span class="emphasis"><em>Default:</em></span> <code class="literal">false</code></p><p><span class="emphasis"><em>Example:</em></span> <code class="literal">true</code></p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path" target="_top">
&lt;home-manager/nixos/common.nix&gt;
</a></code></td></tr></table></dd><dt><span class="term"><a id="nixos-opt-home-manager.users"></a><a class="link" href="nixos-options.html#nixos-opt-home-manager.users"><code class="option">home-manager.users</code></a></span></dt><dd><p>Per-user Home Manager configuration.</p><p><span class="emphasis"><em>Type:</em></span> attribute set of (Home Manager module)</p><p><span class="emphasis"><em>Default:</em></span> <code class="literal">{ }</code></p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path" target="_top">
&lt;home-manager/nixos/common.nix&gt;
</a></code></td></tr></table></dd><dt><span class="term"><a id="nixos-opt-home-manager.verbose"></a><a class="link" href="nixos-options.html#nixos-opt-home-manager.verbose"><code class="option">home-manager.verbose</code></a></span></dt><dd><p>Whether to enable verbose output on activation.</p><p><span class="emphasis"><em>Type:</em></span> boolean</p><p><span class="emphasis"><em>Default:</em></span> <code class="literal">false</code></p><p><span class="emphasis"><em>Example:</em></span> <code class="literal">true</code></p><p><span class="emphasis"><em>Declared by:</em></span></p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename"><a class="filename" href="https://github.com/nix-community/home-manager/blob/master/nixos/common.nix#blob-path" target="_top">
&lt;home-manager/nixos/common.nix&gt;
</a></code></td></tr></table></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="options.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="nix-darwin-options.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A. Configuration Options </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix C. nix-darwin Module Options</td></tr></table></div></body></html>