<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=User_Environment</id>
	<title>User Environment - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=User_Environment"/>
	<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;action=history"/>
	<updated>2026-05-31T00:55:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=31973&amp;oldid=prev</id>
		<title>DHCP: /* Environment variables */ use syntaxhighlight console and &quot;$&quot; for the shell command sample</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=31973&amp;oldid=prev"/>
		<updated>2026-05-20T22:32:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Environment variables: &lt;/span&gt; use syntaxhighlight console and &amp;quot;$&amp;quot; for the shell command sample&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:32, 20 May 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This would look like:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This would look like:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  ❯ &lt;/del&gt;ls -l ~/.nix-profile&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=console&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  &lt;/del&gt;lrwxrwxrwx ... /home/username/.nix-profile -&amp;gt; /nix/var/nix/profiles/per-user/username/profile&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$ &lt;/ins&gt;ls -l ~/.nix-profile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;lrwxrwxrwx ... /home/username/.nix-profile -&amp;gt; /nix/var/nix/profiles/per-user/username/profile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Package management section ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Package management section ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-19376:rev-31973:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>DHCP</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=19376&amp;oldid=prev</id>
		<title>AveryKoen at 20:55, 30 December 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=19376&amp;oldid=prev"/>
		<updated>2024-12-30T20:55:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:55, 30 December 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;User Environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. Different users can have their own separate environments, and individual users can create multiple environments they can switch between.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;User Environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. Different users can have their own separate environments, and individual users can create multiple environments they can switch between.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In Nix and NixOS, a user environment is a core concept in understanding how the system operates. This page serves as a quick reference. More documentation is present in parts of the {{Nix Manual}} and in the {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - Python Install Guide|anchor=#python}}, interspersed with Python install instructions.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In Nix and NixOS, a user environment is a core concept in understanding how the system operates. This page serves as a quick reference. More documentation is present in parts of the {{Nix Manual}} and in the {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - Python Install Guide|anchor=#python}}, interspersed with &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;Python&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/ins&gt;install instructions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Nix manual references ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Nix manual references ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-11707:rev-19376:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>AveryKoen</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=11707&amp;oldid=prev</id>
		<title>Sdht0: Copy edit</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=11707&amp;oldid=prev"/>
		<updated>2024-04-06T16:51:43Z</updated>

		<summary type="html">&lt;p&gt;Copy edit&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:51, 6 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Profiles and &lt;/del&gt;&#039;&#039;&#039;&#039;&#039;User Environments&#039;&#039;&#039;&#039;&#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;There may be many user environments: different &lt;/del&gt;users can have &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;different &lt;/del&gt;environments, and individual users can switch between &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;different environments. In Nix &amp;amp;mdash; and thus, NixOS &amp;amp;mdash; a &#039;&#039;&#039;&#039;&#039;User Environment&#039;&#039;&#039;&#039;&#039; is a core concept in understanding how the system operates&lt;/del&gt;.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;&#039;&#039;User Environments&#039;&#039;&#039;&#039;&#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Different &lt;/ins&gt;users can have &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;their own separate &lt;/ins&gt;environments, and individual users &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;can create multiple environments they &lt;/ins&gt;can switch between.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;As such&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;it &lt;/del&gt;is &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;covered in pieces &lt;/del&gt;in &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;many parts of &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Nix Manual}}&lt;/del&gt;. This page serves as a quick reference. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Note, user environments are not currently covered at all &lt;/del&gt;in the {{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;NixOS &lt;/del&gt;Manual}}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. User environments are mentioned &lt;/del&gt;in the {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - Python Install Guide|anchor=#python}}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;; there&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a brief summary &lt;/del&gt;interspersed with Python install instructions.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In Nix and NixOS&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a user environment &lt;/ins&gt;is &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a core concept &lt;/ins&gt;in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;understanding how &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;system operates&lt;/ins&gt;. This page serves as a quick reference. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;More documentation is present &lt;/ins&gt;in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;parts of &lt;/ins&gt;the {{&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nix &lt;/ins&gt;Manual}} &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/ins&gt;in the {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - Python Install Guide|anchor=#python}}, interspersed with Python install instructions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Nix manual references ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Nix manual references ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-9262:rev-11707:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Sdht0</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9262&amp;oldid=prev</id>
		<title>imported&gt;Nix: /* Environment variables */ trim for width</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9262&amp;oldid=prev"/>
		<updated>2021-10-16T02:55:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Environment variables: &lt;/span&gt; trim for width&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:55, 16 October 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l14&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This would look like:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This would look like:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   ❯ ls -l ~/.nix-profile&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   ❯ ls -l ~/.nix-profile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   lrwxrwxrwx &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1 username users 43 Sep 13 16:13 &lt;/del&gt;/home/username/.nix-profile -&amp;gt; /nix/var/nix/profiles/per-user/username/profile&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   lrwxrwxrwx &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;... &lt;/ins&gt;/home/username/.nix-profile -&amp;gt; /nix/var/nix/profiles/per-user/username/profile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Package management section ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Package management section ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-9261:rev-9262:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Nix</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9261&amp;oldid=prev</id>
		<title>imported&gt;Nix: fix title</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9261&amp;oldid=prev"/>
		<updated>2021-09-21T09:14:16Z</updated>

		<summary type="html">&lt;p&gt;fix title&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:14, 21 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot;&gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Profiles ====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Profiles ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the opening of the {{Nix Manual|name=Nix Manual - &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Basic Package Management &lt;/del&gt;chapter|anchor=#sec-profiles}}:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the opening of the {{Nix Manual|name=Nix Manual - &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Profiles &lt;/ins&gt;chapter|anchor=#sec-profiles}}:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;Profiles and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. To understand how they work, it’s useful to know a bit about how Nix works. In Nix, packages are stored in unique locations in the Nix store (typically, &amp;#039;&amp;#039;/nix/store&amp;#039;&amp;#039;). For instance, a particular version of the Subversion package might be stored in a directory &amp;#039;&amp;#039;/nix/store/dpmvp969yhdqs7lm2r1a3gng7pyq6vy4-subversion-1.1.3/&amp;#039;&amp;#039;, while another version might be stored in &amp;#039;&amp;#039;/nix/store/5mq2jcn36ldlmh93yj1n8s9c95pj7c5s-subversion-1.1.2&amp;#039;&amp;#039;. The long strings prefixed to the directory names are cryptographic hashes[1] of all inputs involved in building the package — sources, dependencies, compiler flags, and so on. So if two packages differ in any way, they end up in different locations in the file system, so they don’t interfere with each other. Figure 10.1, “&amp;#039;&amp;#039;User environments&amp;#039;&amp;#039;” shows a part of a typical Nix store.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;Profiles and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. To understand how they work, it’s useful to know a bit about how Nix works. In Nix, packages are stored in unique locations in the Nix store (typically, &amp;#039;&amp;#039;/nix/store&amp;#039;&amp;#039;). For instance, a particular version of the Subversion package might be stored in a directory &amp;#039;&amp;#039;/nix/store/dpmvp969yhdqs7lm2r1a3gng7pyq6vy4-subversion-1.1.3/&amp;#039;&amp;#039;, while another version might be stored in &amp;#039;&amp;#039;/nix/store/5mq2jcn36ldlmh93yj1n8s9c95pj7c5s-subversion-1.1.2&amp;#039;&amp;#039;. The long strings prefixed to the directory names are cryptographic hashes[1] of all inputs involved in building the package — sources, dependencies, compiler flags, and so on. So if two packages differ in any way, they end up in different locations in the file system, so they don’t interfere with each other. Figure 10.1, “&amp;#039;&amp;#039;User environments&amp;#039;&amp;#039;” shows a part of a typical Nix store.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-9260:rev-9261:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Nix</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9260&amp;oldid=prev</id>
		<title>imported&gt;Nix: fix link</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9260&amp;oldid=prev"/>
		<updated>2021-09-21T09:13:25Z</updated>

		<summary type="html">&lt;p&gt;fix link&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:13, 21 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot;&gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Profiles ====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Profiles ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the opening of the {{Nix Manual|name=Nix Manual - Basic Package Management chapter|anchor=#&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ch&lt;/del&gt;-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;basic-package-mgmt&lt;/del&gt;}}:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In the opening of the {{Nix Manual|name=Nix Manual - Basic Package Management chapter|anchor=#&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sec&lt;/ins&gt;-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;profiles&lt;/ins&gt;}}:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;Profiles and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. To understand how they work, it’s useful to know a bit about how Nix works. In Nix, packages are stored in unique locations in the Nix store (typically, &amp;#039;&amp;#039;/nix/store&amp;#039;&amp;#039;). For instance, a particular version of the Subversion package might be stored in a directory &amp;#039;&amp;#039;/nix/store/dpmvp969yhdqs7lm2r1a3gng7pyq6vy4-subversion-1.1.3/&amp;#039;&amp;#039;, while another version might be stored in &amp;#039;&amp;#039;/nix/store/5mq2jcn36ldlmh93yj1n8s9c95pj7c5s-subversion-1.1.2&amp;#039;&amp;#039;. The long strings prefixed to the directory names are cryptographic hashes[1] of all inputs involved in building the package — sources, dependencies, compiler flags, and so on. So if two packages differ in any way, they end up in different locations in the file system, so they don’t interfere with each other. Figure 10.1, “&amp;#039;&amp;#039;User environments&amp;#039;&amp;#039;” shows a part of a typical Nix store.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;Profiles and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. To understand how they work, it’s useful to know a bit about how Nix works. In Nix, packages are stored in unique locations in the Nix store (typically, &amp;#039;&amp;#039;/nix/store&amp;#039;&amp;#039;). For instance, a particular version of the Subversion package might be stored in a directory &amp;#039;&amp;#039;/nix/store/dpmvp969yhdqs7lm2r1a3gng7pyq6vy4-subversion-1.1.3/&amp;#039;&amp;#039;, while another version might be stored in &amp;#039;&amp;#039;/nix/store/5mq2jcn36ldlmh93yj1n8s9c95pj7c5s-subversion-1.1.2&amp;#039;&amp;#039;. The long strings prefixed to the directory names are cryptographic hashes[1] of all inputs involved in building the package — sources, dependencies, compiler flags, and so on. So if two packages differ in any way, they end up in different locations in the file system, so they don’t interfere with each other. Figure 10.1, “&amp;#039;&amp;#039;User environments&amp;#039;&amp;#039;” shows a part of a typical Nix store.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-9259:rev-9260:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Nix</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9259&amp;oldid=prev</id>
		<title>imported&gt;Nix: add Nix and Guide categories</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9259&amp;oldid=prev"/>
		<updated>2021-09-21T09:07:10Z</updated>

		<summary type="html">&lt;p&gt;add Nix and Guide categories&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:07, 21 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l267&quot;&gt;Line 267:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 267:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A symlink to the current &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; of a user, e.g., &amp;#039;&amp;#039;/nix/var/nix/profiles/default&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A symlink to the current &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; of a user, e.g., &amp;#039;&amp;#039;/nix/var/nix/profiles/default&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Nix]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Guide]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-9258:rev-9259:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Nix</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9258&amp;oldid=prev</id>
		<title>imported&gt;Nix: understanding User Environments is really important and the information is spread all over the nix manual, so here I&#039;ve collected all the references</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=User_Environment&amp;diff=9258&amp;oldid=prev"/>
		<updated>2021-09-21T09:06:25Z</updated>

		<summary type="html">&lt;p&gt;understanding User Environments is really important and the information is spread all over the nix manual, so here I&amp;#039;ve collected all the references&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Profiles and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;User Environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. There may be many user environments: different users can have different environments, and individual users can switch between different environments. In Nix &amp;amp;mdash; and thus, NixOS &amp;amp;mdash; a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;User Environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is a core concept in understanding how the system operates. &lt;br /&gt;
&lt;br /&gt;
As such, it is covered in pieces in many parts of the {{Nix Manual}}. This page serves as a quick reference. Note, user environments are not currently covered at all in the {{NixOS Manual}}. User environments are mentioned in the {{Nixpkgs Manual|name=Nixpkgs Manual: Chapter - Python Install Guide|anchor=#python}}; there, a brief summary interspersed with Python install instructions.&lt;br /&gt;
&lt;br /&gt;
== Nix manual references ==&lt;br /&gt;
&lt;br /&gt;
=== Installation section ===&lt;br /&gt;
&lt;br /&gt;
==== Environment variables ====&lt;br /&gt;
In the opening of the {{Nix Manual|name=Nix Manual - Environment Variables chapter|anchor=#ch-env-variables}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The first directory contains the Nix tools themselves, while &amp;#039;&amp;#039;~/.nix-profile&amp;#039;&amp;#039; is a symbolic link to the current user environment (an automatically generated package consisting of symlinks to installed packages).&amp;#039;&amp;#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would look like:&lt;br /&gt;
  ❯ ls -l ~/.nix-profile&lt;br /&gt;
  lrwxrwxrwx 1 username users 43 Sep 13 16:13 /home/username/.nix-profile -&amp;gt; /nix/var/nix/profiles/per-user/username/profile&lt;br /&gt;
&lt;br /&gt;
=== Package management section ===&lt;br /&gt;
&lt;br /&gt;
==== Basic package management ====&lt;br /&gt;
In the opening of the {{Nix Manual|name=Nix Manual - Basic Package Management chapter|anchor=#ch-basic-package-mgmt}}:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;The main command for package management is {{Nix Manual|name=nix-env|anchor=#sec-nix-env}}. You can use it to install, upgrade, and erase packages, and to query what packages are installed or are available for installation.&lt;br /&gt;
&lt;br /&gt;
In Nix, different users can have different “views” on the set of installed applications. That is, there might be lots of applications present on the system (possibly in many different versions), but users can have a specific selection of those active — where “active” just means that it appears in a directory in the user’s PATH. Such a view on the set of installed applications is called a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, which is just a directory tree consisting of symlinks to the files of the active applications.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Profiles ====&lt;br /&gt;
In the opening of the {{Nix Manual|name=Nix Manual - Basic Package Management chapter|anchor=#ch-basic-package-mgmt}}:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Profiles and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are Nix’s mechanism for implementing the ability to allow different users to have different configurations, and to do atomic upgrades and rollbacks. To understand how they work, it’s useful to know a bit about how Nix works. In Nix, packages are stored in unique locations in the Nix store (typically, &amp;#039;&amp;#039;/nix/store&amp;#039;&amp;#039;). For instance, a particular version of the Subversion package might be stored in a directory &amp;#039;&amp;#039;/nix/store/dpmvp969yhdqs7lm2r1a3gng7pyq6vy4-subversion-1.1.3/&amp;#039;&amp;#039;, while another version might be stored in &amp;#039;&amp;#039;/nix/store/5mq2jcn36ldlmh93yj1n8s9c95pj7c5s-subversion-1.1.2&amp;#039;&amp;#039;. The long strings prefixed to the directory names are cryptographic hashes[1] of all inputs involved in building the package — sources, dependencies, compiler flags, and so on. So if two packages differ in any way, they end up in different locations in the file system, so they don’t interfere with each other. Figure 10.1, “&amp;#039;&amp;#039;User environments&amp;#039;&amp;#039;” shows a part of a typical Nix store.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Figure 10.1. User environments&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:NixManual-User-environments.png]]&lt;br /&gt;
&lt;br /&gt;
Of course, you wouldn’t want to type&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;$ /nix/store/dpmvp969yhdq...-subversion-1.1.3/bin/svn&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
every time you want to run Subversion. Of course we could set up the PATH environment variable to include the bin directory of every package we want to use, but this is not very convenient since changing PATH doesn’t take effect for already existing processes. The solution Nix uses is to create directory trees of symlinks to &amp;#039;&amp;#039;activated&amp;#039;&amp;#039; packages. These are called &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and they are packages themselves (though automatically generated by &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;), so they too reside in the Nix store. For instance, in Figure 10.1, “User environments” the user environment &amp;#039;&amp;#039;/nix/store/0c1p5z4kda11...-user-env&amp;#039;&amp;#039; contains a symlink to just Subversion 1.1.2 (arrows in the figure indicate symlinks). This would be what we would obtain if we had done&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;$ nix-env -i subversion&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on a set of Nix expressions that contained Subversion 1.1.2.&lt;br /&gt;
&lt;br /&gt;
This doesn’t in itself solve the problem, of course; you wouldn’t want to type &amp;#039;&amp;#039;/nix/store/0c1p5z4kda11...-user-env/bin/svn&amp;#039;&amp;#039; either. That’s why there are symlinks outside of the store that point to the user environments in the store; for instance, the symlinks &amp;#039;&amp;#039;default-42-link&amp;#039;&amp;#039; and &amp;#039;&amp;#039;default-43-link&amp;#039;&amp;#039; in the example. These are called &amp;#039;&amp;#039;generations&amp;#039;&amp;#039; since every time you perform a &amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039; operation, a new &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is generated based on the current one. For instance, generation 43 was created from generation 42 when we did&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;$ nix-env -i subversion firefox&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on a set of Nix expressions that contained Firefox and a new version of Subversion.&lt;br /&gt;
&lt;br /&gt;
Generations are grouped together into &amp;#039;&amp;#039;profiles&amp;#039;&amp;#039; so that different users don’t interfere with each other if they don’t want to. For example:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;$ ls -l /nix/var/nix/profiles/ &amp;lt;br&amp;gt;&lt;br /&gt;
  ... &amp;lt;br&amp;gt;&lt;br /&gt;
  lrwxrwxrwx  1 eelco ... default-42-link -&amp;gt; /nix/store/0c1p5z4kda11...-user-env &amp;lt;br&amp;gt;&lt;br /&gt;
  lrwxrwxrwx  1 eelco ... default-43-link -&amp;gt; /nix/store/3aw2pdyx2jfc...-user-env &amp;lt;br&amp;gt;&lt;br /&gt;
  lrwxrwxrwx  1 eelco ... default -&amp;gt; default-43-link&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This shows a profile called &amp;#039;&amp;#039;default&amp;#039;&amp;#039;. The file &amp;#039;&amp;#039;default&amp;#039;&amp;#039; itself is actually a symlink that points to the current generation. When we do a &amp;#039;&amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039;&amp;#039; operation, a new &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and generation link are created based on the current one, and finally the default symlink is made to point at the new generation. This last step is atomic on Unix, which explains how we can do atomic upgrades. (Note that the building/installing of new packages doesn’t interfere in any way with old packages, since they are stored in different locations in the Nix store.)&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Garbage collection ====&lt;br /&gt;
In the opening of the {{Nix Manual|name=Nix Manual - Garbage Collection chapter|anchor=#sec-garbage-collection}}:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039;&amp;#039; operations such as upgrades (&amp;#039;&amp;#039;&amp;#039;-u&amp;#039;&amp;#039;&amp;#039;) and uninstall (&amp;#039;&amp;#039;&amp;#039;-e&amp;#039;&amp;#039;&amp;#039;) never actually delete packages from the system. All they do (as shown above) is to create a new &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; that no longer contains symlinks to the “deleted” packages.&lt;br /&gt;
&lt;br /&gt;
Of course, since disk space is not infinite, unused packages should be removed at some point. You can do this by running the Nix garbage collector. It will remove from the Nix store any package not used (directly or indirectly) by any generation of any profile.&lt;br /&gt;
&lt;br /&gt;
Note however that as long as old generations reference a package, it will not be deleted. After all, we wouldn’t be able to do a rollback otherwise. So in order for garbage collection to be effective, you should also delete (some) old generations. Of course, this should only be done if you are certain that you will not need to roll back.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command reference section ===&lt;br /&gt;
&lt;br /&gt;
==== Main commands ====&lt;br /&gt;
&lt;br /&gt;
===== nix-env =====&lt;br /&gt;
In the {{Nix Manual|name=Nix Manual - Main Commands chapter|anchor=#sec-nix-env}}:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039;&amp;#039; — manipulate or query Nix &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The command &amp;#039;&amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039;&amp;#039; is used to manipulate Nix &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;User environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; are sets of software packages available to a user at some point in time. In other words, they are a synthesised view of the programs available in the Nix store. There may be many &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;: different users can have different environments, and individual users can switch between different environments.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Common options&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;--profile / -p path&amp;lt;/code&amp;gt;&lt;br /&gt;
Specifies the profile to be used by those operations that operate on a profile (designated below as the &amp;#039;&amp;#039;active profile&amp;#039;&amp;#039;). A profile is a sequence of &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; called &amp;#039;&amp;#039;generations&amp;#039;&amp;#039;, one of which is the &amp;#039;&amp;#039;current generation&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;~/.nix-profile&amp;lt;/code&amp;gt;&lt;br /&gt;
A symbolic link to the user&amp;#039;s current profile. By default, this symlink points to &amp;#039;&amp;#039;prefix/var/nix/profiles/default&amp;#039;&amp;#039;. The PATH environment variable should include &amp;#039;&amp;#039;~/.nix-profile/bin&amp;#039;&amp;#039; for the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to be visible to the user.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Operation --install&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Synopsis&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;nix-env { --install | -i } [ { --prebuilt-only | -b } ] [ { --attr | -A } ] [--from-expression] [-E] [--from-profile path] [ --preserve-installed | -P ] [ --remove-all | -r ] args...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The install operation creates a new &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, based on the current generation of the active profile, to which a set of store paths described by &amp;#039;&amp;#039;args&amp;#039;&amp;#039; is added. The arguments &amp;#039;&amp;#039;args&amp;#039;&amp;#039; map to store paths in a number of possible ways...&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
You can force the installation of multiple derivations with the same name by being specific about the versions. For instance, nix-env -i gcc-3.3.6 gcc-4.1.1 will install both version of GCC (and will probably cause a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; conflict!).&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;--from-profile path&amp;#039;&amp;#039; is given, &amp;#039;&amp;#039;args&amp;#039;&amp;#039; is a set of names denoting installed store paths in the profile &amp;#039;&amp;#039;path&amp;#039;&amp;#039;. This is an easy way to copy &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; elements from one profile to another.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Operation --upgrade&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Synopsis&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;nix-env { --upgrade | -u } [ { --prebuilt-only | -b } ] [ { --attr | -A } ] [--from-expression] [-E] [--from-profile path] [ --lt | --leq | --eq | --always ] args...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The upgrade operation creates a new &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, based on the current generation of the active profile, in which all store paths are replaced for which there are newer versions in the set of paths described by &amp;#039;&amp;#039;args&amp;#039;&amp;#039;. Paths for which there are no newer versions are left untouched; this is not an error. It is also not an error if an element of &amp;#039;&amp;#039;args&amp;#039;&amp;#039; matches no installed derivations.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Operation --uninstall&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Synopsis&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;nix-env { --uninstall | -e } drvnames...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The uninstall operation creates a new &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, based on the current generation of the active profile, from which the store paths designated by the symbolic names &amp;#039;&amp;#039;names&amp;#039;&amp;#039; are removed.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Operation --set-flag&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Synopsis&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;nix-env --set-flag name value drvnames...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;--set-flag&amp;#039;&amp;#039; operation allows meta attributes of installed packages to be modified. There are several attributes that can be usefully modified, because they affect the behaviour of &amp;#039;&amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039;&amp;#039; or the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; build script:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;priority&amp;#039;&amp;#039;&amp;#039; can be changed to resolve filename clashes. The &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; build script uses the &amp;#039;&amp;#039;meta.priority&amp;#039;&amp;#039; attribute of derivations to resolve filename collisions between packages. Lower priority values denote a higher priority. For instance, the GCC wrapper package and the Binutils package in Nixpkgs both have a file &amp;#039;&amp;#039;bin/ld&amp;#039;&amp;#039;, so previously if you tried to install both you would get a collision. Now, on the other hand, the GCC wrapper declares a higher priority than Binutils, so the former’s &amp;#039;&amp;#039;bin/ld&amp;#039;&amp;#039; is symlinked in the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Operation --switch-generation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Synopsis&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;nix-env { --switch-generation | -G } {generation}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This operation makes generation number &amp;#039;&amp;#039;generation&amp;#039;&amp;#039; the current generation of the active profile. That is, if the &amp;#039;&amp;#039;profile&amp;#039;&amp;#039; is the path to the active profile, then the symlink &amp;#039;&amp;#039;profile&amp;#039;&amp;#039; is made to point to &amp;#039;&amp;#039;profile-generation-link&amp;#039;&amp;#039;, which is in turn a symlink to the actual &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; in the Nix store.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Operation --query&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Synopsis&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;nix-store { --query | -q } { --outputs | --requisites | -R | --references | --referrers | --referrers-closure | --deriver | -d | --graph | --tree | --binding name | -b name | --hash | --size | --roots } [--use-output] [-u] [--force-realise] [-f] paths...&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Examples&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Print the closure (runtime dependencies) of the svn program in the current &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ nix-store -qR $(which svn) &amp;lt;br&amp;gt;&lt;br /&gt;
/nix/store/5mbglq5ldqld8sj57273aljwkfvj22mc-subversion-1.1.4 &amp;lt;br&amp;gt;&lt;br /&gt;
/nix/store/9lz9yc6zgmc0vlqmn2ipcpkjlmbi51vv-glibc-2.3.4 &amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
Make a picture of the runtime dependency graph of the current &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ nix-store -q --graph ~/.nix-profile | dot -Tps &amp;gt; graph.ps &amp;lt;br&amp;gt;&lt;br /&gt;
$ gv graph.ps &amp;lt;br&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== nix-copy-closure =====&lt;br /&gt;
In the {{Nix Manual|name=Nix Manual - Main Commands chapter|anchor=#name-6}}:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;nix-copy-closure&amp;#039;&amp;#039;&amp;#039; - copy a closure to or from a remote machine via SSH&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Synopsis&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;code&amp;gt;nix-copy-closure [ --to | --from ] [--gzip] [--include-outputs] [ --use-substitutes | -s ] [-v] user@machine paths&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
Examples&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
Copy Subversion from a remote machine and then install it into a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ nix-copy-closure --from alice@itchy.labs \ &amp;lt;br&amp;gt;&lt;br /&gt;
    /nix/store/0dj0503hjxy5mbwlafv1rsbdiyx1gkdy-subversion-1.4.4 &amp;lt;br&amp;gt;&lt;br /&gt;
$ nix-env -i /nix/store/0dj0503hjxy5mbwlafv1rsbdiyx1gkdy-subversion-1.4.4 &amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Files ====&lt;br /&gt;
&lt;br /&gt;
===== nix.conf =====&lt;br /&gt;
In the {{Nix Manual|name=Nix Manual - Files chapter|anchor=#ch-files}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Name&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;nix.conf&amp;#039;&amp;#039; - Nix configuration file&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Description&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Nix reads settings from two configuration files:&lt;br /&gt;
&lt;br /&gt;
* The system-wide configuration file &amp;#039;&amp;#039;sysconfdir/nix/nix.conf&amp;#039;&amp;#039; (i.e. &amp;#039;&amp;#039;/etc/nix/nix.conf&amp;#039;&amp;#039; on most systems), or &amp;#039;&amp;#039;$NIX_CONF_DIR/nix.conf&amp;#039;&amp;#039; if &amp;#039;&amp;#039;NIX_CONF_DIR&amp;#039;&amp;#039; is set.&lt;br /&gt;
&lt;br /&gt;
* The user configuration file &amp;#039;&amp;#039;$XDG_CONFIG_HOME/nix/nix.conf&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;~/.config/nix/nix.conf&amp;#039;&amp;#039; if &amp;#039;&amp;#039;XDG_CONFIG_HOME&amp;#039;&amp;#039; is not set.&lt;br /&gt;
&lt;br /&gt;
The configuration files consist of &amp;#039;&amp;#039;name = value&amp;#039;&amp;#039; pairs, one per line. Other files can be included with a line like &amp;#039;&amp;#039;include path&amp;#039;&amp;#039;, where &amp;#039;&amp;#039;path&amp;#039;&amp;#039; is interpreted relative to the current conf file and a missing file is an error unless &amp;#039;&amp;#039;!include&amp;#039;&amp;#039; is used instead. Comments start with a &amp;#039;&amp;#039;&amp;#039;#&amp;#039;&amp;#039;&amp;#039; character. Here is an example configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;keep-outputs = true       # Nice for developers&amp;lt;br&amp;gt;&lt;br /&gt;
keep-derivations = true   # Idem&amp;lt;br&amp;gt;&lt;br /&gt;
You can override settings on the command line using the --option flag, e.g. --option keep-outputs false.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following settings are currently available:&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;keep-env-derivations &amp;lt;/code&amp;gt; &lt;br /&gt;
If &amp;#039;&amp;#039;false&amp;#039;&amp;#039; (default), derivations are not stored in Nix &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environments&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. That is, the derivations of any build-time-only dependencies may be garbage-collected.&lt;br /&gt;
&lt;br /&gt;
If true, when you add a Nix derivation to a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, the path of the derivation is stored in the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Thus, the derivation will not be garbage-collected until the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; generation is deleted (nix-env --delete-generations). To prevent build-time-only dependencies from being collected, you should also turn on keep-outputs.&lt;br /&gt;
&lt;br /&gt;
The difference between this option and keep-derivations is that this one is “sticky”: it applies to any &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; created while this option was enabled, while keep-derivations only applies at the moment the garbage collector is run.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Appendix A. Glossary ===&lt;br /&gt;
In the {{Nix Manual|name=Nix Manual - Appendix A. Glossary|anchor=#part-glossary}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;user environment&amp;lt;/code&amp;gt;&lt;br /&gt;
An automatically generated store object that consists of a set of symlinks to “active” applications, i.e., other store paths. These are generated automatically by &amp;#039;&amp;#039;&amp;#039;nix-env&amp;#039;&amp;#039;&amp;#039;. See Chapter 10, Profiles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;profile&amp;lt;/code&amp;gt;&lt;br /&gt;
A symlink to the current &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;user environment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; of a user, e.g., &amp;#039;&amp;#039;/nix/var/nix/profiles/default&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Nix</name></author>
	</entry>
</feed>