Nix vs. Linux Standard Base: Difference between revisions

Sdht0 (talk | contribs)
Partial copy edit
Package Installation: tweak formatting
Tags: Mobile edit Mobile web edit
Line 7: Line 7:
With Nix, the files of a package go into a ''profile'' (as if it was a rootfs), and users can have as many profiles as they want.
With Nix, the files of a package go into a ''profile'' (as if it was a rootfs), and users can have as many profiles as they want.


By default, the only part of the system made aware of the contents of the user profile is the PATH. The user PATH is set through bashrc to include `~/.nix-profile/bin`. So, by default, installing a Nix package means "having it in the PATH". A simple operation like <code>nix-env -i firefox</code> is meant to update the nix store, then generate a new profile in the store having all the programs ''installed'' plus the new one, and updating the symlink `~/.nix-profile`, so `~/.nix-profile/bin` will contain a symlink to the executable of firefox. Then a user can type <code>firefox</code> and have it running.
By default, the only part of the system made aware of the contents of the user profile is the <code>PATH</code> environment variable. The user <code>PATH</code> is set through bashrc to include <code>~/.nix-profile/bin</code>. So, by default, installing a Nix package means "having it in the PATH". A simple operation like <code>nix-env -i firefox</code> is meant to update the nix store, then generate a new profile in the store having all the programs ''installed'' plus the new one, and updating the symlink <code>~/.nix-profile</code>, so <code>~/.nix-profile/bin</code> will contain a symlink to the executable of firefox. Then a user can type <code>firefox</code> and have it running.


If other kind of files are to be found by programs looking at the usual `<code>/{,usr}/{bin,etc,lib,sbin,...}</code>` locations, other variables may be of help. For example, gcc would welcome <code>CPATH</code> and <code>LIBRARY_PATH</code>. And the dynamic loader will welcome <code>LD_LIBRARY_PATH</code>.
If other kind of files are to be found by programs looking at the usual <code>/{,usr}/{bin,etc,lib,sbin,...}</code> locations, other variables may be of help. For example, gcc would welcome <code>CPATH</code> and <code>LIBRARY_PATH</code>. And the dynamic loader will welcome <code>LD_LIBRARY_PATH</code>.


== Build and install from Source ==
== Build and install from Source ==