Package: collective.recipe.nix
collective.recipe.nixThis is an experimental buildout recipe for creating nix expression from
a buildout eggs list. This is work in progress. Please,contribute.The minimal buildout part should includerecipeandeggs:[releaser]recipe=collective.recipe.nixeggs=zest.releaser[recommended]The recipe generates three kind of expressions:mkDerivation based [name].nix usable with nix-shell and nix-buildbuildEnv based [name]-env.nix usable with nix-buildbuildPythonPackage based [name]-[package].nix usable with nix-env -i -fFo large projects like Plone, it’s recommended to use a local mirrored packageindex/find-linksto avoid connection issues when recipe is resolving
each package fetchurl information. Possible remedies include settingallow-from-cachetotrueto allow recipe to use configured buildout
download cache (and createfile://urls), or just running the buildout
again with help of recipe created cumulative cache
([~/][.]collective.recipe.nix.cfg).Known issue:If a requirement package has setup dependencies defined insetup_requires, those must be defined manually usingpropagated-build-inputsoption for this recipe.Recipe optionseggslist of packages to generate expressions fornamestring to define the name used in the resulting derivation and in the
generated filenames (defaults to part name)prefixstring to set prefix (or path) for generated outputs (defaults to working
directory)partslist of existing buildout sections to install in mkDerivation based expression
(defaults to all but the current section)outputslist of full generated expression filenames to filter outputs to be generated
(defaults to nothing to generate all)allow-from-cacheboolean (true) to allow generated expression to use package  from
buildout download cache (defaults tofalse)build-inputslist of additional build-inputs from nixpkgs for generated expressions (to be
available in nix-shell environment) or list ofpackage=nixpkgsPackagemappings to inject build-inputs for each package’sbuildPythonPackage-expressionpropagated-build-inputslist ofpackage=other.packagemappings to inject additional
requirements for packages (usually to enable some additional features)nixpkgslist ofpackage=pythonPackages.packagemappings to use existing packages
from nixpkgs instead of generating custombuildPythonPackage(useful with
package like Pillow, which need additional care to get built properly)urlslist ofpackage=url#md5=hashmappings to explicitly define package
download URL and MD5 checksum for cases where the recipe fails to resolve
it automaticallySee the project repository for configuration examples.Example of generic useAt first, define./default.nixwith buildout:with import <nixpkgs> {};
stdenv.mkDerivation {
  name = "myEnv";
  buildInputs = [
    libxml2
    libxslt
    pythonPackages.ldap
    pythonPackages.pillow
    pythonPackages.readline
    pythonPackages.zc_buildout_nix
  ];
  shellHook = ''
    export SSL_CERT_FILE=~/.nix-profile/etc/ca-bundle.crt
  '';
}And example./buildout.cfg:[buildout]parts=releaser[releaser]recipe=collective.recipe.nixeggs=zest.releaser[recommended]Run the buildout:$nix-shell--runbuildout-nixNow you should be able to run zest.releaser with recommended plugins with:$nix-shellreleaser.nix--runfullreleaseOr install zest.releaser into your current Nix profile with:$nix-env-i-freleaser-zest_releaser.nixSee the project repository for more configuration examples.Example of building PloneTogether with nixpkgs optimized buildout version (available in nixpkgs), this
recipe can be used to build a Nix derivation using buildout install as in Nix
derivation builder (see the generated mkDerivation based expression for
current example implementation):[buildout]extends=https://dist.plone.org/release/5-latest/versions.cfgparts=ploneversions=versions[instance]recipe=plone.recipe.zope2instanceeggs=Ploneuser=admin:adminenvironment-vars=PTS_LANGUAGES enzope_i18n_allowed_languages envar=/tmp[plone]recipe=collective.recipe.nixparts=instanceeggs=${instance:eggs}outputs=plone.nix[versions]Pillow=setuptools=zc.buildout=zc.recipe.egg=$nix-shell--runbuildout-nix$nix-buildplone.nix-oplone$plone/bin/instancefgChangelog1.0.3 (2015-08-30)Updated pre-defined propagated build inputs with some known setup requires
[datakurre]1.0.2 (2015-07-28)Fix issue where c.recipe.nix part was included in resulting nix expression
[datakurre]1.0.1 (2015-07-28)Fix issue where buildout could not include “ characters
[datakurre]Fix to remove ~/.installed.cfg from built derivation1.0.0 (2015-07-26)First release.