mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
* Improvements to profiles. Generations are now per-profile, e.g.,
default -> default-94-link default-82-link -> /nix/store/cc4480... default-83-link -> /nix/store/caeec8... ... default-94-link -> /nix/store/2896ca... experimental -> experimental-2-link experimental-1-link -> /nix/store/cc4480... experimental-2-link -> /nix/store/a3148f... * `--profile' / `-p' -> `--switch-profile' / `-S' * `--link' / `-l' -> `--profile' / `-p' * The default profile is stored in $prefix/var/nix/profiles. $prefix/var/nix/links is gone. Profiles can be stored anywhere. * The current profile is now referenced from ~/.nix-profile, not ~/.nix-userenv. * The roots to the garbage collector now have extension `.gcroot', not `.id'.
This commit is contained in:
parent
d445da7a7b
commit
66e94d3275
10 changed files with 84 additions and 78 deletions
|
@ -192,9 +192,9 @@ rm -rf /nix/var</screen>
|
|||
To use Nix, some environment variables should be set. In
|
||||
particular, <envar>PATH</envar> should contain the directories
|
||||
<filename><replaceable>prefix</replaceable>/bin</filename> and
|
||||
<filename>~/.nix-userenv/bin</filename>. The first directory
|
||||
<filename>~/.nix-profile/bin</filename>. The first directory
|
||||
contains the Nix tools themselves, while
|
||||
<filename>~/.nix-userenv</filename> is a symbolic link to the
|
||||
<filename>~/.nix-profile</filename> is a symbolic link to the
|
||||
current <emphasis>user environment</emphasis> (an automatically
|
||||
generated package consisting of symlinks to installed packages).
|
||||
The simplest way to set the required environment variables is to
|
||||
|
|
|
@ -111,14 +111,14 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><filename>~/.nix-userenv</filename></term>
|
||||
<term><filename>~/.nix-profile</filename></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A symbolic link to the user's current user environment.
|
||||
By default, it points to
|
||||
<filename><replaceable>prefix</replaceable>/var/nix/links/current</filename>.
|
||||
A symbolic link to the user's current profile. The
|
||||
default profile is
|
||||
<filename><replaceable>prefix</replaceable>/var/nix/profiles/default</filename>.
|
||||
The <envar>PATH</envar> environment variable should
|
||||
include <filename>~/.nix-userenv</filename> for the user
|
||||
include <filename>~/.nix-profile/bin</filename> for the user
|
||||
environment to be visible to the user.
|
||||
</para>
|
||||
</listitem>
|
||||
|
|
|
@ -189,30 +189,32 @@ obtaining list of Nix archives at http://catamaran.labs.cs.uu.nl/dist/nix/nixpkg
|
|||
it can be used immediately, that is, it now appears in a directory in the
|
||||
<envar>PATH</envar> environment variable. Specifically,
|
||||
<envar>PATH</envar> includes the entry
|
||||
<filename><replaceable>prefix</replaceable>/var/nix/links/current/bin</filename>,
|
||||
<filename><replaceable>prefix</replaceable>/var/nix/profiles/default/bin</filename>,
|
||||
where
|
||||
<filename><replaceable>prefix</replaceable>/var/nix/links/current</filename>
|
||||
<filename><replaceable>prefix</replaceable>/var/nix/profiles/default</filename>
|
||||
is just a symlink to the current user environment:
|
||||
</para>
|
||||
|
||||
<screen>
|
||||
$ ls -l /nix/var/nix/links/
|
||||
$ ls -l /nix/var/nix/profiles/
|
||||
...
|
||||
lrwxrwxrwx 1 eelco ... 15 -> /nix/store/1871...12b0-user-environment
|
||||
lrwxrwxrwx 1 eelco ... 16 -> /nix/store/59ba...df6b-user-environment
|
||||
lrwxrwxrwx 1 eelco ... current -> /nix/var/nix/links/16</screen>
|
||||
lrwxrwxrwx 1 eelco ... default-15-link -> /nix/store/1871...12b0-user-environment
|
||||
lrwxrwxrwx 1 eelco ... default-16-link -> /nix/store/59ba...df6b-user-environment
|
||||
lrwxrwxrwx 1 eelco ... default -> default-16-link</screen>
|
||||
|
||||
<para>
|
||||
That is, <filename>current</filename> in this example is a link to
|
||||
<filename>16</filename>, which is the current user environment. Before
|
||||
the installation, it pointed to <filename>15</filename>. Note that this
|
||||
means that you can atomically roll-back to the previous user environment
|
||||
by pointing the symlink <filename>current</filename> at
|
||||
<filename>15</filename> again. This also shows that operations such as
|
||||
installation are atomic in the Nix system: any arbitrarily complex
|
||||
set of installation, uninstallation, or upgrade actions eventually boil
|
||||
down to the single operation of pointing a symlink somewhere else (which
|
||||
can be implemented atomically in Unix).
|
||||
That is, <filename>default</filename> in this example is a link
|
||||
to <filename>default-16-link</filename>, which is the current
|
||||
user environment. Before the installation, it pointed to
|
||||
<filename>default-15-link</filename>. Note that this means that
|
||||
you can atomically roll-back to the previous user environment by
|
||||
pointing the symlink <filename>default</filename> at
|
||||
<filename>default-15-link</filename> again. This also shows
|
||||
that operations such as installation are atomic in the Nix
|
||||
system: any arbitrarily complex set of installation,
|
||||
uninstallation, or upgrade actions eventually boil down to the
|
||||
single operation of pointing a symlink somewhere else (which can
|
||||
be implemented atomically in Unix).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@ -221,15 +223,15 @@ lrwxrwxrwx 1 eelco ... current -> /nix/var/nix/links/16</screen>
|
|||
</para>
|
||||
|
||||
<screen>
|
||||
$ ls -l /nix/var/nix/links/16/bin
|
||||
$ ls -l /nix/var/nix/profiles/default-16-link/bin
|
||||
lrwxrwxrwx 1 eelco ... MozillaFirebird -> /nix/store/35f8...4ae6-MozillaFirebird-0.7/bin/MozillaFirebird
|
||||
lrwxrwxrwx 1 eelco ... svn -> /nix/store/3829...fb5d-subversion-0.32.1/bin/svn
|
||||
...</screen>
|
||||
|
||||
<para>
|
||||
Note that, e.g., <filename>svn</filename> =
|
||||
<filename>/nix/var/nix/links/current/bin/svn</filename> =
|
||||
<filename>/nix/var/nix/links/16/bin/svn</filename> =
|
||||
<filename>/nix/var/nix/profiles/default/bin/svn</filename> =
|
||||
<filename>/nix/var/nix/profiles/default-16-link/bin/svn</filename> =
|
||||
<filename>/nix/store/59ba...df6b-user-environment/bin/svn</filename> =
|
||||
<filename>/nix/store/3829...fb5d-subversion-0.32.1/bin/svn</filename>.
|
||||
</para>
|
||||
|
|
|
@ -93,7 +93,7 @@ $ nix-env -iBf nixpkgs-<replaceable>version</replaceable>/ hello MozillaFirebird
|
|||
|
||||
<screen>
|
||||
$ which hello
|
||||
/home/eelco/.nix-userenv/bin/hello
|
||||
/home/eelco/.nix-profile/bin/hello
|
||||
$ hello
|
||||
Hello, world!
|
||||
$ MozillaFirebird
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue