nixpkgs/nixos/tests/nixos-test-driver
Philip Munksgaard 8e5d6f456d
nixos/test-driver: add defaultText to pythonTestDriverPackage
After d95261b435, the following flake.nix fails:

```nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  outputs = { nixpkgs, ... }: {
    nixosConfigurations.demo = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ({ lib, ... }: {
          boot.loader.grub.enable = false;
          fileSystems."/" = { device = "none"; fsType = "tmpfs"; };
          nixpkgs.config.packageOverrides =
            lib.mkIf false (_: { });
        })
      ];
    };
  };
}
```

This is the error:

```
$ nix build /tmp/tmp.vWEVitTgK9/#nixosConfigurations.demo.config.system.build.toplevel
evaluation warning: system.stateVersion is not set, defaulting to 26.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'nixos-system-nixos-26.05.20260409.4c1018d'
         whose name attribute is located at /nix/store/anvdcc2arw7kqrvwnidvhw6ypkkvws68-source/pkgs/stdenv/generic/make-derivation.nix:541:11

       … while evaluating attribute 'buildCommand' of derivation 'nixos-system-nixos-26.05.20260409.4c1018d'
         at /nix/store/anvdcc2arw7kqrvwnidvhw6ypkkvws68-source/nixos/modules/system/activation/top-level.nix:64:7:
           63|       passAsFile = [ "extraDependencies" ];
           64|       buildCommand = systemBuilder;
             |       ^
           65|

       … while evaluating the option `environment.etc.dbus-1.source':

       … while evaluating the default value of option `pythonTestDriverPackage`

       … while evaluating the module argument `hostPkgs' in "/nix/store/anvdcc2arw7kqrvwnidvhw6ypkkvws68-source/nixos/lib/testing/driver.nix":

       … noting that argument `hostPkgs` is not externally provided, so querying `_module.args` instead, requiring `config`

       … while evaluating the option `hostPkgs':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The option `hostPkgs' was accessed but has no value defined. Try setting the option.
```

Setting a `defaultText` fixes the issue.

I've also added a regression test under `nixos/tests/nixos-test-driver/` and
fixed a typo in the option description ("implemetnation").
2026-05-29 11:17:25 +02:00
..
busybox.nix
console-log.nix nixos/test-driver: Add machine.get_console_log() 2025-09-12 16:46:03 +02:00
containers.nix nixosTests.test-containers-bittorrent: enable in hydra 2026-05-17 14:10:42 -07:00
extra-python-packages.nix
lib-extend.nix
node-name.nix
options-doc-regression.nix nixos/test-driver: add defaultText to pythonTestDriverPackage 2026-05-29 11:17:25 +02:00
skip-typecheck.nix nixosTests.simple-vm: rename from nixosTests.simple 2026-05-22 21:24:28 +10:00
ssh-backdoor.nix nixos/test-driver: use vhost-device-vsock for SSH backdoor 2026-04-15 15:45:33 +01:00
timeout.nix