[Nix-dev] PERL5LIB and lib.makePerlPath

Daniel Hlynskyi abcz2.uprola at gmail.com
Wed Aug 3 19:27:38 CEST 2016


So, I found a hackish solution. Just create a new derivation with PERL5LIB
as it's output

# perl5lib.nix
packages:
  let pkgs = import <nixpkgs> {};
in builtins.readFile (builtins.toString (pkgs.stdenv.mkDerivation {
  name = "PERL5LIB";
  buildInputs = [pkgs.perl] ++ packages;
  buildCommand = "echo $PERL5LIB > $out";
}))

$ nix-instantiate --read-write-mode --eval -E 'with import <nixpkgs>{};
(import ./perl5lib.nix) [perlPackages.DBDPg]'
"/nix/store/...-perl-5.22.1/lib/perl5/site_perl:/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl:/nix/store/...-perl-DBI-1.634/lib/perl5/site_perl\n"

It looks to me I'm reinventing a wheel...


2016-08-02 13:39 GMT+03:00 Daniel Hlynskyi <abcz2.uprola at gmail.com>:

> Hi. There is a function lib.makePerlPath
>
> $ nix-instantiate --eval -E 'with import <nixpkgs>{}; lib.makePerlPath
> [perlPackages.DBDPg]'
> "/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl"
>
> I want a similar function, which includes deps too (for wrapper)
>
> $ nix-instantiate --eval -E 'with import <nixpkgs>{}; lib.makeFullPerlPath
> [perlPackages.DBDPg]'
>
> "/nix/store/...-perl-DBD-Pg-3.5.3/lib/perl5/site_perl:/nix/store/...-perl-DBI-1.634/lib/perl5/site_perl"
>
> Has anybody done this already?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160803/64d107ae/attachment.html>


More information about the nix-dev mailing list