[Nix-dev] Using Nix as a package manager (for yet another language)

Sergey Mironov grrwlf at gmail.com
Fri Feb 12 12:52:31 CET 2016


Hi, List. I've just noticed a long topic regarding using NIx as a
package manager for a language. Сoincidentally, I use Nix for the same
purpose: I am working on packaging UrWeb libraries using Nix.

Here is the combinators library I wrote
[1] - https://github.com/grwlf/urweb-build/blob/master/default.nix
Here is an example of package recipe script
[2] - https://github.com/grwlf/urweb-soup/blob/master/build.nix

Nix-build works fine as a replacement for GNU Make. But here comes an
interesting question. What if I want to package a Nix-driven library
for NixOS ?? I don't know how to do it at the moment.

The problem is at the line 7 of [1]: I import <nixpkgs> here.
Packaging this 'build-script' for NixOS means running nix-build from
the builder of mkDerivation, in pure environment where we do not have
NIX_PATH (am I right?). And AFAIK it is a top of an iceberg.

So what do you think, how to call nix-build from the mkDerivation's
build script and make it aware of the same Nixpkgs tree the top-level
nix-build (which runs current mkDerivation) uses?

Regards,
Sergey


More information about the nix-dev mailing list