summary refs log tree commit diff
path: root/nixos/lib/testing/legacy.nix
blob: 868b8b65b17d563845dd3eb06596f91962330df5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ config, options, lib, ... }:
let
  inherit (lib) mkIf mkOption types;
in
{
  # This needs options.warnings, which we don't have (yet?).
  # imports = [
  #   (lib.mkRenamedOptionModule [ "machine" ] [ "nodes" "machine" ])
  # ];

  options = {
    machine = mkOption {
      internal = true;
      type = types.raw;
    };
  };

  config = {
    nodes = mkIf options.machine.isDefined (
      lib.warn
        "In test `${config.name}': The `machine' attribute in NixOS tests (pkgs.nixosTest / make-test-python.nix / testing-python.nix / makeTest) is deprecated. Please set the equivalent `nodes.machine'."
        { inherit (config) machine; }
    );
  };
}