I want to clarify regarding dependencies installed by Nix. I have a linux installation which has packages D1 and D2 installed. Now I install Nix and then a package through Nix which needs dependencies D1 and D2. Will Nix reinstall D1 and D2 again or will it omit these dependencies since they are already installed on basal linux system?
1 Answers
No, Nix does not recognize already installed packages. It cannot without breaking with one of its core concepts: Reliability.
Consider what happens if the base system administrator (which may be not you) removes one of those packages (D1 or D2): The package installed by Nix, which depends on these packages, would no longer work. Or, more subtle, what happens when the dependencies installed on the base system are updated to newer versions, with which the software packaged by Nix is not compatible?
There's, however, a so called native stdenv
, used on some platforms, which uses some of the tools found in native directories (/usr/bin
and friends).
Based on that you could write your own stdenv
which is using a set of tools (that you can ensure that they'll be there and working) from your base system.

- 15,896
- 2
- 36
- 63
-
What about sharing packages within the Nix system? If I install 2 gtk applications, will both of them install all gtk libraries? That is, will there be 2 gtk libraries installed in Nix package system? – rnso Nov 25 '15 at 13:03
-
They will of course share their dependencies, unless they need different versions, though :) Thus you'd only have the gtk versions installed once in your case. – Daniel Jour Nov 25 '15 at 14:35