Nix vs. Linux Standard Base: Difference between revisions
Partial copy edit
imported>Nix m (move to pedias category) |
(Partial copy edit) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This article is a comparison between the | This article is a comparison between the [[Nix package manager]] and the [https://en.wikipedia.org/wiki/Linux_Standard_Base Linux Standard Base] (LSB) standard that the package managers of most conventional Linux distributions follow. | ||
== Package Installation == | == Package Installation == | ||
In most distributions, | In most distributions, files of an installed package are stored under <code>/{,usr}/{bin,etc,lib,...}</code>. | ||
With Nix, the | 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 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. | ||
Line 31: | Line 31: | ||
== Modifying a Package == | == Modifying a Package == | ||
In LSB distributions, | In LSB distributions, files installed under {{ic|/usr}} can be edited by the user as needed. | ||
Files in the Nix store ({{ic|/nix/store}}) are meant to be read-only and changes are only done using the {{ic|nix}} commands. {{ic|nix-store --verify --check-contents}} can be used to ensure integrity of the store data. | |||
To make changes to Nix packages properly, see [[Modifying a Package]]. | |||
== See also == | |||
* [https://ostreedev.github.io/ostree/related-projects/#nixos--nix OSTree comparison to NixOS] — OSTree, a project to offer [https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard FHS]-compatible "stores", was in large part inspired by NixOS. | |||
[[Category:Pedias]] | [[Category:Pedias]] |