Nix can be used to build any kind of package. But here I'm just going to focus on the simple C&C++ case.
Firstly we have to know that the final built packages will located inside /nix/store
. Which is globally readable directory of all build inputs and build outputs of the Nix system. The emphasis is on readable, not writable, that is /nix/store
is meant to be modified by the user or programs except for the Nix system utilities. This centralises the management of packages, and keeps our packages and package configuration consistent.
So what exactly are we trying to build. Our goal is to build a directory that will be located in /nix/store/*-package-version/
, where *
is the hash of the package. Preferably a version
is also available, but some C&C++ packages don't have versions, so in that case, there's only /nix/store/*-package/
.
What will be inside this directory? It follows the GNU Coding Standards descri