[Nix-dev] NixOS configuration unit tests

Wout Mertens wout.mertens at gmail.com
Fri Jan 23 15:04:22 CET 2015

I'm thinking that it might be a good idea to have unit tests for the
configuration.nix descriptions. That way we can be more sure that a change
doesn't have unintended consequences.

For example, we could have tests like "if you set config.foo and
config.bar, the evaluation should fail" and "if you set config.foo then
config.baz should get a value".

One specific use case is the license whitelisting/blacklisting (
https://github.com/NixOS/nixpkgs/pull/5892), where we don't ever want to
inadvertently allow forbidden licenses.

Any thoughts on how to implement this? An approach might be a shell script
that runs a few nix-instantiate command lines and expects errors and
values, but how would that integrate with the nixos tests?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150123/ecd77b19/attachment.html 

More information about the nix-dev mailing list