Nix vs. Linux Standard Base: Difference between revisions

Tags: Mobile edit Mobile web edit
Roxwize (talk | contribs)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
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.
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, files of an installed package are stored under <code>/{,usr}/{bin,etc,lib,...}</code>.
In most distributions, files of an installed package are stored under <code>/{,usr}/{bin,etc,lib,...}</code>.
Line 11: Line 11:
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 ==


In most LSB distributions, you ask for the development tools to be installed into the system. And then you also install dependencies of the package you want to build, and then go on building the source you downloaded. The dependencies are found, and your program builds fine.
In most LSB distributions, you ask for the development tools to be installed into the system. And then you also install dependencies of the package you want to build, and then go on building the source you downloaded. The dependencies are found, and your program builds fine.
Line 30: Line 30:
That can be achieved only following the nix style. So, letting nix build your program from source, instead of doing that on your own in your interactive shell through profiles. Nix will provide a common build system, with whatever stated dependencies available at build time, and will also provide a target installation directory. This requires knowing how to write [http://hydra.nixos.org/job/nix/trunk/tarball/latest/download-by-type/doc/manual/#id460419 simple stdenv derivations], and knowing [https://nixos.org/nix/manual/#chap-quick-start where to write them].
That can be achieved only following the nix style. So, letting nix build your program from source, instead of doing that on your own in your interactive shell through profiles. Nix will provide a common build system, with whatever stated dependencies available at build time, and will also provide a target installation directory. This requires knowing how to write [http://hydra.nixos.org/job/nix/trunk/tarball/latest/download-by-type/doc/manual/#id460419 simple stdenv derivations], and knowing [https://nixos.org/nix/manual/#chap-quick-start where to write them].


== Modifying a Package ==
== Modifying a package ==
In LSB distributions, files installed under {{ic|/usr}} can be edited by the user as needed.
In LSB distributions, files installed under {{ic|/usr}} can be edited by the user as needed.


Line 39: Line 39:
== See also ==
== See also ==


* [https://ostreedev.github.io/ostree/related-projects/#nixos--nix OSTree comparison to NixOS] &mdash; OSTree, a project to offer [https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard FHS]-compatible "stores", was in large part inspired by NixOS.
* [https://ostreedev.github.io/ostree/related-projects/#nixos--nix libostree comparison to NixOS] &mdash; libostree, 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]]