[Nix-dev] How to access makeTest function from nixpkgs/nixos/lib/testing.nix?

Tomasz Czyż tomasz.czyz at gmail.com
Thu Jun 23 01:23:07 CEST 2016


Hello,

I found makeTest function from nixos useful and I would like to use it in
my projects for building integration testing environments.

The only method I found by now, how to access it is:

(import <nixpkgs/nixos/lib/testing.nix>).makeTest

The problem is: in the script I'm running, the fixed nixpkgs version is
passed as "pkgs" argument. The script must test programs against that
specific nixpkgs version.

I see two options:
1. grab makeTest command from pinned nixpkgs
2. grab makeTest from <nixpkgs> and pass pinned nixpkgs as argument to
makeTest (and further to machine/nodes).

1. I couldn't find the attribute which is pointing to that function or
file, if looks like I can access it only using path syntax like
<nixpkgs/nixos/lib/testing.nix>. Is there any way to get path for current
"pkgs" set? Or are there any other ways how I can access this file/function?

2. I didn't find any way to pass pkgs argument down the stack, looks like
other funtions inside makeTest are just importing pkgs from "local" files
so probably this way won't work.

3. I could copy the files and bind them to attributes but I prefer to avoid
that if possible.

If anyone have some suggestions please let me know.

Tom

-- 
Tomasz Czyż
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160623/97bca7bc/attachment.html>


More information about the nix-dev mailing list