1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 00:39:45 +01:00
This commit is contained in:
rycee 2024-10-25 08:24:35 +00:00
parent 99c67113d3
commit e090f86894
2 changed files with 294 additions and 2 deletions

View file

@ -33,7 +33,7 @@
</div>
<hr />
</div>
<div class="toc"> <p><strong>Table of Contents</strong></p> <dl class="toc"> <dt> <span class="preface"> <a href="index.xhtml#preface">Preface</a> </span></dt><dt> <span class="part"> <a href="index.xhtml#ch-introduction">Introduction to Home Manager</a> </span></dt><dt> <span class="part"> <a href="index.xhtml#ch-installation">Installing Home Manager</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-install-standalone">Standalone installation</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-install-nixos-module">NixOS module</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-install-nix-darwin-module">nix-darwin module</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-usage">Using Home Manager</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-usage-configuration">Configuration Example</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-rollbacks">Rollbacks</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-dotfiles">Keeping your ~ safe from harm</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-graphical">Graphical services</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-updating">Updating</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-nix-flakes">Nix Flakes</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-flakes-prerequisites">Prerequisites</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-flakes-standalone">Standalone setup</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-flakes-nixos-module">NixOS module</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-flakes-nix-darwin-module">nix-darwin module</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-writing-modules">Writing Home Manager Modules</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-option-types">Option Types</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-contributing">Contributing</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-contrib-getting-started">Getting started</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines">Guidelines</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-news">News</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-tests">Tests</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-3rd-party">Third-Party Tools and Extensions</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-3rd-party-module-collections">Module Collections</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-faq">Frequently Asked Questions (FAQ)</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#_why_is_there_a_collision_error_when_switching_generation">Why is there a collision error when switching generation?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_why_are_the_session_variables_not_set">Why are the session variables not set?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_how_to_set_up_a_configuration_for_multiple_users_machines">How to set up a configuration for multiple users/machines?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal">Why do I get an error message about <code class="literal">ca.desrt.dconf</code> or <code class="literal">dconf.service</code>?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_how_do_i_install_packages_from_nixpkgs_unstable">How do I install packages from Nixpkgs unstable?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_how_do_i_change_the_package_used_by_a_module">How do I change the package used by a module?</a> </span></dt></dl></dd><dt> <span class="appendix"> <a href="options.xhtml">A. Home Manager Configuration Options</a> </span></dt><dt> <span class="appendix"> <a href="nixos-options.xhtml">B. NixOS Configuration Options</a> </span></dt><dt> <span class="appendix"> <a href="nix-darwin-options.xhtml">C. nix-darwin Configuration Options</a> </span></dt><dt> <span class="appendix"> <a href="release-notes.xhtml">D. Release Notes</a> </span></dt> </dl></div>
<div class="toc"> <p><strong>Table of Contents</strong></p> <dl class="toc"> <dt> <span class="preface"> <a href="index.xhtml#preface">Preface</a> </span></dt><dt> <span class="part"> <a href="index.xhtml#ch-introduction">Introduction to Home Manager</a> </span></dt><dt> <span class="part"> <a href="index.xhtml#ch-installation">Installing Home Manager</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-install-standalone">Standalone installation</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-install-nixos-module">NixOS module</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-install-nix-darwin-module">nix-darwin module</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-usage">Using Home Manager</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-usage-configuration">Configuration Example</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-rollbacks">Rollbacks</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-dotfiles">Keeping your ~ safe from harm</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-graphical">Graphical services</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-gpu-non-nixos">GPU on non-NixOS systems</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-updating">Updating</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-nix-flakes">Nix Flakes</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-flakes-prerequisites">Prerequisites</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-flakes-standalone">Standalone setup</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-flakes-nixos-module">NixOS module</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-flakes-nix-darwin-module">nix-darwin module</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-writing-modules">Writing Home Manager Modules</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-option-types">Option Types</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-contributing">Contributing</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-contrib-getting-started">Getting started</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines">Guidelines</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-news">News</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-tests">Tests</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-3rd-party">Third-Party Tools and Extensions</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#sec-3rd-party-module-collections">Module Collections</a> </span></dt></dl></dd><dt> <span class="part"> <a href="index.xhtml#ch-faq">Frequently Asked Questions (FAQ)</a> </span></dt><dd><dl><dt> <span class="section"> <a href="index.xhtml#_why_is_there_a_collision_error_when_switching_generation">Why is there a collision error when switching generation?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_why_are_the_session_variables_not_set">Why are the session variables not set?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_how_to_set_up_a_configuration_for_multiple_users_machines">How to set up a configuration for multiple users/machines?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal">Why do I get an error message about <code class="literal">ca.desrt.dconf</code> or <code class="literal">dconf.service</code>?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_how_do_i_install_packages_from_nixpkgs_unstable">How do I install packages from Nixpkgs unstable?</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_how_do_i_change_the_package_used_by_a_module">How do I change the package used by a module?</a> </span></dt></dl></dd><dt> <span class="appendix"> <a href="options.xhtml">A. Home Manager Configuration Options</a> </span></dt><dt> <span class="appendix"> <a href="nixos-options.xhtml">B. NixOS Configuration Options</a> </span></dt><dt> <span class="appendix"> <a href="nix-darwin-options.xhtml">C. nix-darwin Configuration Options</a> </span></dt><dt> <span class="appendix"> <a href="release-notes.xhtml">D. Release Notes</a> </span></dt> </dl></div>
<div class="preface"> <div class="titlepage"> <div> <div> <h1 id="preface" class="title" >Preface </h1> </div> </div></div><p>This manual will eventually describe how to install, use, and extend Home
Manager.</p><p>If you encounter problems then please reach out on the IRC channel
<a class="link" href="https://webchat.oftc.net/?channels=home-manager" target="_top">#home-manager</a>
@ -235,7 +235,7 @@ the option. You can find the complete option documentation in
</code></pre><p>Once a configuration is successfully built, it can be activated. The
activation performs the steps necessary to make the files, programs, and
services available in your user environment. The <code class="literal">home-manager switch</code>
command performs a combined build and activation.</p><div class="toc"> <p><strong>Table of Contents</strong></p> <dl class="toc"> <dt> <span class="section"> <a href="index.xhtml#sec-usage-configuration">Configuration Example</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-rollbacks">Rollbacks</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-dotfiles">Keeping your ~ safe from harm</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-graphical">Graphical services</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-updating">Updating</a> </span></dt> </dl></div></div><div class="section"> <div class="titlepage"> <div> <div> <h2 id="sec-usage-configuration" class="title" style="clear: both">Configuration Example </h2> </div> </div></div><p>A fresh install of Home Manager will generate a minimal
command performs a combined build and activation.</p><div class="toc"> <p><strong>Table of Contents</strong></p> <dl class="toc"> <dt> <span class="section"> <a href="index.xhtml#sec-usage-configuration">Configuration Example</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-rollbacks">Rollbacks</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-dotfiles">Keeping your ~ safe from harm</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-graphical">Graphical services</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-usage-gpu-non-nixos">GPU on non-NixOS systems</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-updating">Updating</a> </span></dt> </dl></div></div><div class="section"> <div class="titlepage"> <div> <div> <h2 id="sec-usage-configuration" class="title" style="clear: both">Configuration Example </h2> </div> </div></div><p>A fresh install of Home Manager will generate a minimal
<code class="literal">~/.config/home-manager/home.nix</code> file containing something like</p><pre><code class="programlisting nix">{ config, pkgs, ... }:
{
@ -370,6 +370,59 @@ like</p><pre><code class="programlisting nix">{
# …
}
</code></pre><p>in your Home Manager configuration.</p>
</div><div class="section"> <div class="titlepage"> <div> <div> <h2 id="sec-usage-gpu-non-nixos" class="title" style="clear: both">GPU on non-NixOS systems </h2> </div> </div></div><p>To access the GPU, programs need access to OpenGL and Vulkan libraries. While
this works transparently on NixOS, it does not on other Linux systems. A
solution is provided by <a class="link" href="https://github.com/nix-community/nixGL" target="_top">NixGL</a>, which
can be integrated into Home Manager.</p><p>To enable the integration, import NixGL into your home configuration, either as
a channel, or as a flake input passed via <code class="literal">extraSpecialArgs</code>. Then, set the
<code class="literal">nixGL.packages</code> option to the package set provided by NixGL.</p><p>Once integration is enabled, it can be used in two ways: as Nix functions for
wrapping programs installed via Home Manager, and as shell commands for running
programs installed by other means (such as <code class="literal">nix shell</code>). In either case, there
are several wrappers available. They can be broadly categorized</p><div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc;"><li class="listitem"><p>by vendor: as Mesa (for Free drivers of all vendors) and Nvidia (for
Nvidia-specific proprietary drivers).</p></li><li class="listitem"><p>by GPU selection: as primary and secondary (offloading).</p></li></ul></div><p>For example, the <code class="literal">mesa</code> wrapper provides support for running programs on the
primary GPU for Intel, AMD and Nouveau drivers, while the <code class="literal">mesaPrime</code> wrapper
does the same for the secondary GPU.</p><p><span class="strong"><strong>Note:</strong></span> when using Nvidia wrappers together with flakes, your home
configuration will not be pure and needs to be built using <code class="literal">home-manager switch --impure</code>. Otherwise, the build will fail, complaining about missing attribute
<code class="literal">currentTime</code>.</p><p>Wrapper functions are available under <code class="literal">config.lib.nixGL.wrappers</code>. However, it
can be more convenient to use the <code class="literal">config.lib.nixGL.wrap</code> alias, which can be
configured to use any of the wrappers. It is intended to provide a customization
point when the same home configuration is used across several machines with
different hardware. There is also the <code class="literal">config.lib.nixGL.wrapOffload</code> alias for
two-GPU systems.</p><p>Another convenience is that all wrapper functions are always available. However,
when <code class="literal">nixGL.packages</code> option is unset, they are no-ops. This allows them to be
used even when the home configuration is used on NixOS machines. The exception
is the <code class="literal">prime-offload</code> script which ignores <code class="literal">nixGL.packages</code> and is installed
into the environment whenever <code class="literal">nixGL.prime.installScript</code> is set. This script,
which can be used to start a program on a secondary GPU, does not depend on
NixGL and is useful on NixOS systems as well.</p><p>Below is an abbreviated example for an Optimus laptop that makes use of both
Mesa and Nvidia wrappers, where the latter is used in dGPU offloading mode. It
demonstrates how to wrap <code class="literal">mpv</code> to run on the integrated Intel GPU, wrap FreeCAD
to run on the Nvidia dGPU, and how to install the wrapper scripts. It also wraps
Xonotic to run on the dGPU, but uses the wrapper function directly for
demonstration purposes.</p><pre><code class="programlisting nix">{ config, lib, pkgs, nixgl, ... }:
{
nixGL.packages = nixgl.packages;
nixGL.defaultWrapper = &quot;mesa&quot;;
nixGL.offloadWrapper = &quot;nvidiaPrime&quot;;
nixGL.installScripts = [ &quot;mesa&quot; &quot;nvidiaPrime&quot; ];
programs.mpv = {
enable = true;
package = config.lib.nixGL.wrap pkgs.mpv;
};
home.packages = [
(config.lib.nixGL.wrapOffload pkgs.freecad)
(config.lib.nixGL.wrappers.nvidiaPrime pkgs.xonotic)
];
}
</code></pre><p>The above example assumes a flake-based setup where <code class="literal">nixgl</code> was passed from the
flake. When using channels, the example would instead begin with</p><pre><code class="programlisting nix">{ config, lib, pkgs, ... }:
{
nixGL.packages = import &lt;nixgl&gt; { inherit pkgs; };
# The rest is the same as above
...
</code></pre>
</div><div class="section"> <div class="titlepage"> <div> <div> <h2 id="sec-updating" class="title" style="clear: both">Updating </h2> </div> </div></div><p>If you have installed Home Manager using the Nix channel method then
updating Home Manager is done by first updating the channel. You can
then switch to the updated Home Manager environment.</p><pre><code class="programlisting shell">$ nix-channel --update

View file

@ -11540,6 +11540,245 @@ attribute set of (Nix config atom (null, bool, int, float, str, path or package)
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.packages"></a><a class="term" href="options.xhtml#opt-nixGL.packages"><code class="option">nixGL.packages</code>
</a>
</span>
</dt>
<dd>
<p>The nixGL package set containing GPU library wrappers. This can be used
to provide OpenGL and Vulkan access to applications on non-NixOS systems
by using <code class="literal">(config.lib.nixGL.wrap &lt;package&gt;)</code> for the default wrapper, or
<code class="literal">(config.lib.nixGL.wrappers.&lt;wrapper&gt; &lt;package&gt;)</code> for any available
wrapper.</p><p>The wrapper functions are always available. If this option is empty (the
default), they are a no-op. This is useful on NixOS where the wrappers
are unnecessary.</p><p>Note that using any Nvidia wrapper requires building the configuration
with the <code class="literal">--impure</code> option.</p>
<p><span class="emphasis"><em>Type:</em></span>
null or (attribute set)</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">inputs.nixGL.packages</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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.defaultWrapper"></a><a class="term" href="options.xhtml#opt-nixGL.defaultWrapper"><code class="option">nixGL.defaultWrapper</code>
</a>
</span>
</dt>
<dd>
<p>The package wrapper function available for use as <code class="literal">(config.lib.nixGL.wrap &lt;package&gt;)</code>. Intended to start programs on the main GPU.</p><p>Wrapper functions can be found under <code class="literal">config.lib.nixGL.wrappers</code>. They
can be used directly, however, setting this option provides a convenient
shorthand.</p><p>The following wrappers are available:</p><div class="itemizedlist"><ul class="itemizedlist " style="list-style-type: disc;"><li class="listitem"><p>mesa</p></li><li class="listitem"><p>mesaPrime</p></li><li class="listitem"><p>nvidia</p></li><li class="listitem"><p>nvidiaPrime</p></li></ul></div>
<p><span class="emphasis"><em>Type:</em></span>
one of “mesa”, “mesaPrime”, “nvidia”, “nvidiaPrime”</p>
<p><span class="emphasis"><em>Default:</em></span>
<code class="literal">&quot;mesa&quot;</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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.installScripts"></a><a class="term" href="options.xhtml#opt-nixGL.installScripts"><code class="option">nixGL.installScripts</code>
</a>
</span>
</dt>
<dd>
<p>For each wrapper <code class="literal">wrp</code> named in the provided list, a wrapper script
named <code class="literal">nixGLWrp</code> is installed into the environment. These scripts are
useful for running programs not installed via Home Manager.</p><p>The following wrappers are available:</p><div class="itemizedlist"><ul class="itemizedlist " style="list-style-type: disc;"><li class="listitem"><p>mesa</p></li><li class="listitem"><p>mesaPrime</p></li><li class="listitem"><p>nvidia</p></li><li class="listitem"><p>nvidiaPrime</p></li></ul></div>
<p><span class="emphasis"><em>Type:</em></span>
null or (list of (one of “mesa”, “mesaPrime”, “nvidia”, “nvidiaPrime”))</p>
<p><span class="emphasis"><em>Default:</em></span>
<code class="literal">null</code></p>
<p><span class="emphasis"><em>Example:</em></span></p><pre><code class="programlisting">[
&quot;mesa&quot;
&quot;mesaPrime&quot;
]
</code></pre>
<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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.offloadWrapper"></a><a class="term" href="options.xhtml#opt-nixGL.offloadWrapper"><code class="option">nixGL.offloadWrapper</code>
</a>
</span>
</dt>
<dd>
<p>The package wrapper function available for use as
<code class="literal">(config.lib.nixGL.wrapOffload &lt;package&gt;)</code>. Intended to start programs
on the secondary GPU.</p><p>Wrapper functions can be found under <code class="literal">config.lib.nixGL.wrappers</code>. They
can be used directly, however, setting this option provides a convenient
shorthand.</p><p>The following wrappers are available:</p><div class="itemizedlist"><ul class="itemizedlist " style="list-style-type: disc;"><li class="listitem"><p>mesa</p></li><li class="listitem"><p>mesaPrime</p></li><li class="listitem"><p>nvidia</p></li><li class="listitem"><p>nvidiaPrime</p></li></ul></div>
<p><span class="emphasis"><em>Type:</em></span>
one of “mesa”, “mesaPrime”, “nvidia”, “nvidiaPrime”</p>
<p><span class="emphasis"><em>Default:</em></span>
<code class="literal">&quot;mesaPrime&quot;</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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.prime.card"></a><a class="term" href="options.xhtml#opt-nixGL.prime.card"><code class="option">nixGL.prime.card</code>
</a>
</span>
</dt>
<dd>
<p>Selects the non-default graphics card used for PRIME render offloading.
The value can be:</p><div class="itemizedlist"><ul class="itemizedlist " style="list-style-type: disc;"><li class="listitem"><p>a number, selecting the n-th non-default GPU;</p></li><li class="listitem"><p>a PCI bus id in the form <code class="literal">pci-XXX_YY_ZZ_U</code>;</p></li><li class="listitem"><p>a PCI id in the form <code class="literal">vendor_id:device_id</code></p></li></ul></div><p>For more information, consult the Mesa documentation on the <code class="literal">DRI_PRIME</code>
environment variable.</p>
<p><span class="emphasis"><em>Type:</em></span>
string</p>
<p><span class="emphasis"><em>Default:</em></span>
<code class="literal">&quot;1&quot;</code></p>
<p><span class="emphasis"><em>Example:</em></span>
<code class="literal">&quot;pci-0000_06_00_0&quot;</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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.prime.installScript"></a><a class="term" href="options.xhtml#opt-nixGL.prime.installScript"><code class="option">nixGL.prime.installScript</code>
</a>
</span>
</dt>
<dd>
<p>If this option is set, the wrapper script <code class="literal">prime-offload</code> is installed
into the environment. It allows starting programs on the secondary GPU
selected by the <code class="literal">nixGL.prime.card</code> option. This makes sense when the
program is not already using one of nixGL PRIME wrappers, or for
programs not installed from Nixpkgs.</p><p>This option can be set to either “mesa” or “nvidia”, making the script
use one or the other graphics library.</p>
<p><span class="emphasis"><em>Type:</em></span>
null or one of “mesa”, “nvidia”</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">&quot;mesa&quot;</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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.prime.nvidiaProvider"></a><a class="term" href="options.xhtml#opt-nixGL.prime.nvidiaProvider"><code class="option">nixGL.prime.nvidiaProvider</code>
</a>
</span>
</dt>
<dd>
<p>If this option is set, it overrides the offload provider for Nvidia
PRIME offloading. Consult the proprietary Nvidia driver documentation
on the <code class="literal">__NV_PRIME_RENDER_OFFLOAD_PROVIDER</code> environment variable.</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">&quot;NVIDIA-G0&quot;</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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixGL.vulkan.enable"></a><a class="term" href="options.xhtml#opt-nixGL.vulkan.enable"><code class="option">nixGL.vulkan.enable</code>
</a>
</span>
</dt>
<dd>
<p>Whether to enable Vulkan in nixGL wrappers.</p><p>This is disabled by default bacause Vulkan brings in several libraries
that can cause symbol version conflicts in wrapped programs. Your
mileage may vary.</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/modules/misc/nixgl.nix" target="_top">
&lt;home-manager/modules/misc/nixgl.nix&gt;
</a></code>
</td></tr>
</table>
</dd>
<dt>
<span class="term">
<a id="opt-nixpkgs.config"></a><a class="term" href="options.xhtml#opt-nixpkgs.config"><code class="option">nixpkgs.config</code>