1 { config, hostPkgs, lib, ... }:
3 inherit (lib) types mkOption mdDoc;
8 type = types.lazyAttrsOf types.raw;
10 Attributes to add to the returned derivations,
11 which are not necessarily part of the build.
13 This is a bit like doing `drv // { myAttr = true; }` (which would be lost by `overrideAttrs`).
14 It does not change the actual derivation, but adds the attribute nonetheless, so that
15 consumers of what would be `drv` have more information.
19 rawTestDerivation = mkOption {
21 description = mdDoc ''
22 Unfiltered version of `test`, for troubleshooting the test framework and `testBuildFailure` in the test framework's test suite.
23 This is not intended for general use. Use `test` instead.
30 # TODO: can the interactive driver be configured to access the network?
31 description = mdDoc ''
32 Derivation that runs the test as its "build" process.
34 This implies that NixOS tests run isolated from the network, making them
41 rawTestDerivation = hostPkgs.stdenv.mkDerivation {
42 name = "vm-test-run-${config.name}";
44 requiredSystemFeatures = [ "kvm" "nixos-test" ];
49 # effectively mute the XMLLogger
50 export LOGFILE=/dev/null
52 ${config.driver}/bin/nixos-test-driver -o $out
55 passthru = config.passthru;
59 test = lib.lazyDerivation { # lazyDerivation improves performance when only passthru items and/or meta are used.
60 derivation = config.rawTestDerivation;
61 inherit (config) passthru meta;
64 # useful for inspection (debugging / exploration)
65 passthru.config = config;