Merge pull request #165035 from roberth/nixosTest-remove-machine-arg

nixosTest: remove `machine` syntax sugar
main
Robert Hensing 2 years ago committed by GitHub
commit 16c5f5534d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      nixos/doc/manual/development/writing-nixos-tests.section.md
  2. 43
      nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml
  3. 1
      nixos/lib/testing-python.nix
  4. 2
      nixos/tests/aesmd.nix
  5. 2
      nixos/tests/agda.nix
  6. 2
      nixos/tests/airsonic.nix
  7. 2
      nixos/tests/amazon-init-shell.nix
  8. 2
      nixos/tests/apfs.nix
  9. 2
      nixos/tests/apparmor.nix
  10. 2
      nixos/tests/atd.nix
  11. 12
      nixos/tests/atop.nix
  12. 2
      nixos/tests/bcachefs.nix
  13. 2
      nixos/tests/beanstalkd.nix
  14. 2
      nixos/tests/bees.nix
  15. 2
      nixos/tests/bind.nix
  16. 2
      nixos/tests/bitcoind.nix
  17. 2
      nixos/tests/blockbook-frontend.nix
  18. 2
      nixos/tests/boot-stage1.nix
  19. 6
      nixos/tests/boot.nix
  20. 2
      nixos/tests/bpf.nix
  21. 2
      nixos/tests/breitbandmessung.nix
  22. 2
      nixos/tests/brscan5.nix
  23. 2
      nixos/tests/buildkite-agents.nix
  24. 2
      nixos/tests/cage.nix
  25. 2
      nixos/tests/cagebreak.nix
  26. 2
      nixos/tests/cfssl.nix
  27. 2
      nixos/tests/clickhouse.nix
  28. 2
      nixos/tests/cloud-init.nix
  29. 2
      nixos/tests/cntr.nix
  30. 2
      nixos/tests/collectd.nix
  31. 2
      nixos/tests/containers-bridge.nix
  32. 2
      nixos/tests/containers-custom-pkgs.nix
  33. 2
      nixos/tests/containers-ephemeral.nix
  34. 2
      nixos/tests/containers-extra_veth.nix
  35. 2
      nixos/tests/containers-hosts.nix
  36. 2
      nixos/tests/containers-imperative.nix
  37. 2
      nixos/tests/containers-ip.nix
  38. 2
      nixos/tests/containers-names.nix
  39. 2
      nixos/tests/containers-nested.nix
  40. 2
      nixos/tests/containers-portforward.nix
  41. 2
      nixos/tests/containers-tmpfs.nix
  42. 2
      nixos/tests/custom-ca.nix
  43. 2
      nixos/tests/disable-installer-tools.nix
  44. 2
      nixos/tests/dnsdist.nix
  45. 2
      nixos/tests/doas.nix
  46. 2
      nixos/tests/documize.nix
  47. 2
      nixos/tests/domination.nix
  48. 2
      nixos/tests/dovecot.nix
  49. 2
      nixos/tests/ecryptfs.nix
  50. 2
      nixos/tests/emacs-daemon.nix
  51. 2
      nixos/tests/enlightenment.nix
  52. 2
      nixos/tests/env.nix
  53. 2
      nixos/tests/etebase-server.nix
  54. 2
      nixos/tests/etesync-dav.nix
  55. 2
      nixos/tests/fancontrol.nix
  56. 2
      nixos/tests/fcitx/default.nix
  57. 2
      nixos/tests/firefox.nix
  58. 2
      nixos/tests/fish.nix
  59. 2
      nixos/tests/fluentd.nix
  60. 2
      nixos/tests/fontconfig-default-fonts.nix
  61. 2
      nixos/tests/fsck.nix
  62. 2
      nixos/tests/ft2-clone.nix
  63. 2
      nixos/tests/geth.nix
  64. 2
      nixos/tests/gnome-xorg.nix
  65. 2
      nixos/tests/gnome.nix
  66. 2
      nixos/tests/gotify-server.nix
  67. 2
      nixos/tests/graylog.nix
  68. 2
      nixos/tests/grocy.nix
  69. 2
      nixos/tests/grub.nix
  70. 2
      nixos/tests/hardened.nix
  71. 2
      nixos/tests/herbstluftwm.nix
  72. 2
      nixos/tests/hibernate.nix
  73. 2
      nixos/tests/hitch/default.nix
  74. 2
      nixos/tests/hocker-fetchdocker/default.nix
  75. 2
      nixos/tests/hockeypuck.nix
  76. 2
      nixos/tests/hostname.nix
  77. 2
      nixos/tests/hound.nix
  78. 2
      nixos/tests/hydra/default.nix
  79. 2
      nixos/tests/i3wm.nix
  80. 2
      nixos/tests/ihatemoney/default.nix
  81. 2
      nixos/tests/incron.nix
  82. 2
      nixos/tests/initrd-network.nix
  83. 2
      nixos/tests/initrd-secrets.nix
  84. 2
      nixos/tests/input-remapper.nix
  85. 2
      nixos/tests/installed-tests/default.nix
  86. 2
      nixos/tests/invidious.nix
  87. 2
      nixos/tests/isso.nix
  88. 2
      nixos/tests/jellyfin.nix
  89. 2
      nixos/tests/jibri.nix
  90. 2
      nixos/tests/k3s-single-node-docker.nix
  91. 2
      nixos/tests/k3s-single-node.nix
  92. 2
      nixos/tests/kbd-setfont-decompress.nix
  93. 2
      nixos/tests/kbd-update-search-paths-patch.nix
  94. 2
      nixos/tests/keepassxc.nix
  95. 2
      nixos/tests/kerberos/heimdal.nix
  96. 2
      nixos/tests/kerberos/mit.nix
  97. 2
      nixos/tests/kernel-generic.nix
  98. 2
      nixos/tests/kernel-latest-ath-user-regd.nix
  99. 2
      nixos/tests/kexec.nix
  100. 2
      nixos/tests/krb5/deprecated-config.nix
  101. Some files were not shown because too many files have changed in this diff Show More

@ -5,15 +5,9 @@ A NixOS test is a Nix expression that has the following structure:
```nix
import ./make-test-python.nix {
# Either the configuration of a single machine:
machine =
{ config, pkgs, ... }:
{ configuration…
};
# Or a set of machines:
# One or more machines:
nodes =
{ machine1 =
{ machine =
{ config, pkgs, ... }: { … };
machine2 =
{ config, pkgs, ... }: { … };
@ -29,17 +23,16 @@ import ./make-test-python.nix {
The attribute `testScript` is a bit of Python code that executes the
test (described below). During the test, it will start one or more
virtual machines, the configuration of which is described by the
attribute `machine` (if you need only one machine in your test) or by
the attribute `nodes` (if you need multiple machines). For instance,
[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix)
only needs a single machine to test whether users can log in
virtual machines, the configuration of which is described by
the attribute `nodes`.
An example of a single-node test is
[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix).
It only needs a single machine to test whether users can log in
on the virtual console, whether device ownership is correctly maintained
when switching between consoles, and so on. On the other hand,
[`nfs/simple.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix),
which tests NFS client and server functionality in the
Linux kernel (including whether locks are maintained across server
crashes), requires three machines: a server and two clients.
when switching between consoles, and so on. An interesting multi-node test is
[`nfs/simple.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix).
It uses two client nodes to test correct locking across server crashes.
There are a few special NixOS configuration options for test VMs:
@ -67,8 +60,7 @@ The test script is a sequence of Python statements that perform various
actions, such as starting VMs, executing commands in the VMs, and so on.
Each virtual machine is represented as an object stored in the variable
`name` if this is also the identifier of the machine in the declarative
config. If you didn\'t specify multiple machines using the `nodes`
attribute, it is just `machine`. The following example starts the
config. If you specified a node `nodes.machine`, the following example starts the
machine, waits until it has finished booting, then executes a command
and checks that the output is more-or-less correct:
@ -79,7 +71,7 @@ if not "Linux" in machine.succeed("uname"):
raise Exception("Wrong OS")
```
The first line is actually unnecessary; machines are implicitly started
The first line is technically unnecessary; machines are implicitly started
when you first execute an action on them (such as `wait_for_unit` or
`succeed`). If you have multiple machines, you can speed up the test by
starting them in parallel:
@ -303,7 +295,7 @@ For faster dev cycles it\'s also possible to disable the code-linters
```nix
import ./make-test-python.nix {
skipLint = true;
machine =
nodes.machine =
{ config, pkgs, ... }:
{ configuration…
};

@ -6,15 +6,9 @@
<programlisting language="bash">
import ./make-test-python.nix {
# Either the configuration of a single machine:
machine =
{ config, pkgs, ... }:
{ configuration…
};
# Or a set of machines:
# One or more machines:
nodes =
{ machine1 =
{ machine =
{ config, pkgs, ... }: { … };
machine2 =
{ config, pkgs, ... }: { … };
@ -31,18 +25,18 @@ import ./make-test-python.nix {
The attribute <literal>testScript</literal> is a bit of Python code
that executes the test (described below). During the test, it will
start one or more virtual machines, the configuration of which is
described by the attribute <literal>machine</literal> (if you need
only one machine in your test) or by the attribute
<literal>nodes</literal> (if you need multiple machines). For
instance,
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix"><literal>login.nix</literal></link>
only needs a single machine to test whether users can log in on the
virtual console, whether device ownership is correctly maintained
when switching between consoles, and so on. On the other hand,
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix"><literal>nfs/simple.nix</literal></link>,
which tests NFS client and server functionality in the Linux kernel
(including whether locks are maintained across server crashes),
requires three machines: a server and two clients.
described by the attribute <literal>nodes</literal>.
</para>
<para>
An example of a single-node test is
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix"><literal>login.nix</literal></link>.
It only needs a single machine to test whether users can log in on
the virtual console, whether device ownership is correctly
maintained when switching between consoles, and so on. An
interesting multi-node test is
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix"><literal>nfs/simple.nix</literal></link>.
It uses two client nodes to test correct locking across server
crashes.
</para>
<para>
There are a few special NixOS configuration options for test VMs:
@ -94,9 +88,8 @@ import ./make-test-python.nix {
various actions, such as starting VMs, executing commands in the
VMs, and so on. Each virtual machine is represented as an object
stored in the variable <literal>name</literal> if this is also the
identifier of the machine in the declarative config. If you didn't
specify multiple machines using the <literal>nodes</literal>
attribute, it is just <literal>machine</literal>. The following
identifier of the machine in the declarative config. If you
specified a node <literal>nodes.machine</literal>, the following
example starts the machine, waits until it has finished booting,
then executes a command and checks that the output is more-or-less
correct:
@ -108,7 +101,7 @@ if not &quot;Linux&quot; in machine.succeed(&quot;uname&quot;):
raise Exception(&quot;Wrong OS&quot;)
</programlisting>
<para>
The first line is actually unnecessary; machines are implicitly
The first line is technically unnecessary; machines are implicitly
started when you first execute an action on them (such as
<literal>wait_for_unit</literal> or <literal>succeed</literal>). If
you have multiple machines, you can speed up the test by starting
@ -554,7 +547,7 @@ machine.wait_for_unit(&quot;xautolock.service&quot;, &quot;x-session-user&quot;)
<programlisting language="bash">
import ./make-test-python.nix {
skipLint = true;
machine =
nodes.machine =
{ config, pkgs, ... }:
{ configuration…
};

@ -206,6 +206,7 @@ rec {
)];
};
in
lib.warnIf (t?machine) "In test `${name}': The `machine' attribute in NixOS tests (pkgs.nixosTest / make-test-pyton.nix / testing-python.nix / makeTest) is deprecated. Please use the equivalent `nodes.machine'."
build-vms.buildVirtualNetwork (
nodes // lib.optionalAttrs (machine != null) { inherit machine; }
);

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ veehaitch ];
};
machine = { lib, ... }: {
nodes.machine = { lib, ... }: {
services.aesmd = {
enable = true;
settings = {

@ -15,7 +15,7 @@ in
maintainers = [ alexarice turion ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
environment.systemPackages = [
(pkgs.agda.withPackages {
pkgs = p: [ p.standard-library ];

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = [ sumnerevans ];
};
machine =
nodes.machine =
{ pkgs, ... }:
{
services.airsonic = {

@ -18,7 +18,7 @@ makeTest {
meta = with maintainers; {
maintainers = [ urbas ];
};
machine = { ... }:
nodes.machine = { ... }:
{
imports = [ ../modules/profiles/headless.nix ../modules/virtualisation/amazon-init.nix ];
services.openssh.enable = true;

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
name = "apfs";
meta.maintainers = with pkgs.lib.maintainers; [ Luflosi ];
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
virtualisation.emptyDiskImages = [ 1024 ];
boot.supportedFilesystems = [ "apfs" ];

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... } : {
maintainers = [ julm ];
};
machine =
nodes.machine =
{ lib, pkgs, config, ... }:
with lib;
{

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
maintainers = [ bjornfor ];
};
machine =
nodes.machine =
{ ... }:
{ services.atd.enable = true;
users.users.alice = { isNormalUser = true; };

@ -107,7 +107,7 @@ in
{
justThePackage = makeTest {
name = "atop-justThePackage";
machine = {
nodes.machine = {
environment.systemPackages = [ pkgs.atop ];
};
testScript = with assertions; builtins.concatStringsSep "\n" [
@ -123,7 +123,7 @@ in
};
defaults = makeTest {
name = "atop-defaults";
machine = {
nodes.machine = {
programs.atop = {
enable = true;
};
@ -141,7 +141,7 @@ in
};
minimal = makeTest {
name = "atop-minimal";
machine = {
nodes.machine = {
programs.atop = {
enable = true;
atopService.enable = false;
@ -162,7 +162,7 @@ in
};
netatop = makeTest {
name = "atop-netatop";
machine = {
nodes.machine = {
programs.atop = {
enable = true;
netatop.enable = true;
@ -181,7 +181,7 @@ in
};
atopgpu = makeTest {
name = "atop-atopgpu";
machine = {
nodes.machine = {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (getName pkg) [
"cudatoolkit"
];
@ -204,7 +204,7 @@ in
};
everything = makeTest {
name = "atop-everthing";
machine = {
nodes.machine = {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (getName pkg) [
"cudatoolkit"
];

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
name = "bcachefs";
meta.maintainers = with pkgs.lib.maintainers; [ chiiruno ];
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
virtualisation.emptyDiskImages = [ 4096 ];
networking.hostId = "deadbeef";
boot.supportedFilesystems = [ "bcachefs" ];

@ -28,7 +28,7 @@ in
name = "beanstalkd";
meta.maintainers = [ lib.maintainers.aanderse ];
machine =
nodes.machine =
{ ... }:
{ services.beanstalkd.enable = true;
};

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }:
{
name = "bees";
machine = { config, pkgs, ... }: {
nodes.machine = { config, pkgs, ... }: {
boot.initrd.postDeviceCommands = ''
${pkgs.btrfs-progs}/bin/mkfs.btrfs -f -L aux1 /dev/vdb
${pkgs.btrfs-progs}/bin/mkfs.btrfs -f -L aux2 /dev/vdc

@ -1,7 +1,7 @@
import ./make-test-python.nix {
name = "bind";
machine = { pkgs, lib, ... }: {
nodes.machine = { pkgs, lib, ... }: {
services.bind.enable = true;
services.bind.extraOptions = "empty-zones-enable no;";
services.bind.zones = lib.singleton {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = with maintainers; [ _1000101 ];
};
machine = { ... }: {
nodes.machine = { ... }: {
services.bitcoind."mainnet" = {
enable = true;
rpc = {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = with maintainers; [ _1000101 ];
};
machine = { ... }: {
nodes.machine = { ... }: {
services.blockbook-frontend."test" = {
enable = true;
};

@ -1,7 +1,7 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "boot-stage1";
machine = { config, pkgs, lib, ... }: {
nodes.machine = { config, pkgs, lib, ... }: {
boot.extraModulePackages = let
compileKernelModule = name: source: pkgs.runCommandCC name rec {
inherit source;

@ -42,7 +42,7 @@ let
nodes = { };
testScript =
''
machine = create_machine(${machineConfig})
nodes.machine = create_machine(${machineConfig})
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("nix store verify --no-trust -r --option experimental-features nix-command /run/current-system")
@ -83,7 +83,7 @@ let
name = "boot-netboot-" + name;
nodes = { };
testScript = ''
machine = create_machine(${machineConfig})
nodes.machine = create_machine(${machineConfig})
machine.start()
machine.wait_for_unit("multi-user.target")
machine.shutdown()
@ -138,7 +138,7 @@ in {
if os.system("qemu-img create -f qcow2 -F raw -b ${sdImage} ${mutableImage}") != 0:
raise RuntimeError("Could not create mutable linked image")
machine = create_machine(${machineConfig})
nodes.machine = create_machine(${machineConfig})
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("nix store verify -r --no-trust --option experimental-features nix-command /run/current-system")

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
name = "bpf";
meta.maintainers = with pkgs.lib.maintainers; [ martinetd ];
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
programs.bcc.enable = true;
environment.systemPackages = with pkgs; [ bpftrace ];
};

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ lib, ... }: {
name = "breitbandmessung";
meta.maintainers = with lib.maintainers; [ b4dm4n ];
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
imports = [
./common/user-account.nix
./common/x11.nix

@ -7,7 +7,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
maintainers = [ mattchrist ];
};
machine = { pkgs, ... }:
nodes.machine = { pkgs, ... }:
{
nixpkgs.config.allowUnfree = true;
hardware.sane = {

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
maintainers = [ flokli ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
services.buildkite-agents = {
one = {
privateSshKeyPath = (import ./ssh-keys.nix pkgs).snakeOilPrivateKey;

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, ...} :
maintainers = [ matthewbauer ];
};
machine = { ... }:
nodes.machine = { ... }:
{
imports = [ ./common/user-account.nix ];

@ -13,7 +13,7 @@ in
maintainers = [ berbiche ];
};
machine = { config, ... }:
nodes.machine = { config, ... }:
let
alice = config.users.users.alice;
in {

@ -1,7 +1,7 @@
import ./make-test-python.nix ({ pkgs, ...} : {
name = "cfssl";
machine = { config, lib, pkgs, ... }:
nodes.machine = { config, lib, pkgs, ... }:
{
networking.firewall.allowedTCPPorts = [ config.services.cfssl.port ];

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
name = "clickhouse";
meta.maintainers = with pkgs.lib.maintainers; [ ma27 ];
machine = {
nodes.machine = {
services.clickhouse.enable = true;
virtualisation.memorySize = 4096;
};

@ -61,7 +61,7 @@ in makeTest {
meta = with pkgs.lib.maintainers; {
maintainers = [ lewo ];
};
machine = { ... }:
nodes.machine = { ... }:
{
virtualisation.qemu.options = [ "-cdrom" "${metadataDrive}/metadata.iso" ];
services.cloud-init = {

@ -46,7 +46,7 @@ let
meta = with pkgs.lib.maintainers; { maintainers = [ sorki mic92 ]; };
machine = { lib, ... }: {
nodes.machine = { lib, ... }: {
environment.systemPackages = [ pkgs.cntr ];
containers.test = {
autoStart = true;

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
name = "collectd";
meta = { };
machine =
nodes.machine =
{ pkgs, ... }:
{

@ -11,7 +11,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ aristid aszlig eelco kampfschlaefer ];
};
machine =
nodes.machine =
{ pkgs, ... }:
{ imports = [ ../modules/installer/cd-dvd/channel.nix ];
virtualisation.writableStore = true;

@ -12,7 +12,7 @@ in {
maintainers = with lib.maintainers; [ adisbladis earvstedt ];
};
machine = { config, ... }: {
nodes.machine = { config, ... }: {
assertions = let
helloName = (builtins.head config.containers.test.config.system.extraDependencies).name;
in [ {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ patryk27 ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
virtualisation.writableStore = true;
containers.webserver = {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ kampfschlaefer ];
};
machine =
nodes.machine =
{ pkgs, ... }:
{ imports = [ ../modules/installer/cd-dvd/channel.nix ];
virtualisation.writableStore = true;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ montag451 ];
};
machine =
nodes.machine =
{ lib, ... }:
{
virtualisation.vlans = [];

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ aristid aszlig eelco kampfschlaefer ];
};
machine =
nodes.machine =
{ config, pkgs, lib, ... }:
{ imports = [ ../modules/installer/cd-dvd/channel.nix ];

@ -17,7 +17,7 @@ in import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ aristid aszlig eelco kampfschlaefer ];
};
machine =
nodes.machine =
{ pkgs, ... }: {
imports = [ ../modules/installer/cd-dvd/channel.nix ];
virtualisation = {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ patryk27 ];
};
machine = { ... }: {
nodes.machine = { ... }: {
# We're using the newest kernel, so that we can test containers with long names.
# Please see https://github.com/NixOS/nixpkgs/issues/38509 for details.
boot.kernelPackages = pkgs.linuxPackages_latest;

@ -5,7 +5,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
meta = with pkgs.lib.maintainers; { maintainers = [ sorki ]; };
machine = { lib, ... }:
nodes.machine = { lib, ... }:
let
makeNested = subConf: {
containers.nested = {

@ -11,7 +11,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ aristid aszlig eelco kampfschlaefer ianwookim ];
};
machine =
nodes.machine =
{ pkgs, ... }:
{ imports = [ ../modules/installer/cd-dvd/channel.nix ];
virtualisation.writableStore = true;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
maintainers = with lib.maintainers; [ patryk27 ];
};
machine =
nodes.machine =
{ pkgs, ... }:
{ imports = [ ../modules/installer/cd-dvd/channel.nix ];
virtualisation.writableStore = true;

@ -76,7 +76,7 @@ in
enableOCR = true;
machine = { pkgs, ... }:
nodes.machine = { pkgs, ... }:
{ imports = [ ./common/user-account.nix ./common/x11.nix ];
# chromium-based browsers refuse to run as root

@ -3,7 +3,7 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }:
{
name = "disable-installer-tools";
machine =
nodes.machine =
{ pkgs, lib, ... }:
{
system.disableInstallerTools = true;

@ -5,7 +5,7 @@ import ./make-test-python.nix (
maintainers = with maintainers; [ jojosch ];
};
machine = { pkgs, lib, ... }: {
nodes.machine = { pkgs, lib, ... }: {
services.bind = {
enable = true;
extraOptions = "empty-zones-enable no;";

@ -6,7 +6,7 @@ import ./make-test-python.nix (
maintainers = [ cole-h ];
};
machine =
nodes.machine =
{ ... }:
{
users.groups = { foobar = {}; barfoo = {}; baz = { gid = 1337; }; };

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
maintainers = [ ma27 ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
environment.systemPackages = [ pkgs.jq ];
services.documize = {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = [ fgaz ];
};
machine = { config, pkgs, ... }: {
nodes.machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];

@ -1,7 +1,7 @@
import ./make-test-python.nix {
name = "dovecot";
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
imports = [ common/user-account.nix ];
services.postfix.enable = true;
services.dovecot2 = {

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ ... }:
{
name = "ecryptfs";
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
imports = [ ./common/user-account.nix ];
boot.kernelModules = [ "ecryptfs" ];
security.pam.enableEcryptfs = true;

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
enableOCR = true;
machine =
nodes.machine =
{ ... }:
{ imports = [ ./common/x11.nix ];

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, ...} :
maintainers = [ romildo ];
};
machine = { ... }:
nodes.machine = { ... }:
{
imports = [ ./common/user-account.nix ];
services.xserver.enable = true;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
maintainers = [ nequissimus ];
};
machine = { pkgs, ... }:
nodes.machine = { pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages;
environment.etc.plainFile.text = ''

@ -9,7 +9,7 @@ in {
maintainers = [ felschr ];
};
machine = { pkgs, ... }:
nodes.machine = { pkgs, ... }:
{
services.etebase-server = {
inherit dataDir;

@ -5,7 +5,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = [ _3699n ];
};
machine = { config, pkgs, ... }: {
nodes.machine = { config, pkgs, ... }: {
environment.systemPackages = [ pkgs.curl pkgs.etesync-dav ];
};

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... } : {
maintainers = [ evils ];
};
machine = { ... }: {
nodes.machine = { ... }: {
imports = [ ../modules/profiles/minimal.nix ];
hardware.fancontrol.enable = true;
hardware.fancontrol.config = ''

@ -5,7 +5,7 @@ import ../make-test-python.nix (
# copy_from_host works only for store paths
rec {
name = "fcitx";
machine =
nodes.machine =
{
pkgs,
...

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }: {
maintainers = [ eelco shlevy ];
};
machine =
nodes.machine =
{ pkgs, ... }:
{ imports = [ ./common/x11.nix ];

@ -1,7 +1,7 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "fish";
machine =
nodes.machine =
{ pkgs, ... }:
{

@ -1,7 +1,7 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "fluentd";
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
services.fluentd = {
enable = true;
config = ''

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ lib, ... }:
jtojnar
];
machine = { config, pkgs, ... }: {
nodes.machine = { config, pkgs, ... }: {
fonts.enableDefaultFonts = true; # Background fonts
fonts.fonts = with pkgs; [
noto-fonts-emoji

@ -1,7 +1,7 @@
import ./make-test-python.nix {
name = "fsck";
machine = { lib, ... }: {
nodes.machine = { lib, ... }: {
virtualisation.emptyDiskImages = [ 1 ];
virtualisation.fileSystems = {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = [ fgaz ];
};
machine = { config, pkgs, ... }: {
nodes.machine = { config, pkgs, ... }: {
imports = [
./common/x11.nix
];

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = with maintainers; [bachp ];
};
machine = { ... }: {
nodes.machine = { ... }: {
services.geth."mainnet" = {
enable = true;
http = {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
maintainers = teams.gnome.members;
};
machine = { nodes, ... }: let
nodes.machine = { nodes, ... }: let
user = nodes.machine.config.users.users.alice;
in

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
maintainers = teams.gnome.members;
};
machine =
nodes.machine =
{ ... }:
{ imports = [ ./common/user-account.nix ];

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
maintainers = [ ma27 ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
environment.systemPackages = [ pkgs.jq ];
services.gotify = {

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "graylog";
meta.maintainers = with lib.maintainers; [ ];
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
virtualisation.memorySize = 4096;
virtualisation.diskSize = 4096;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = [ ma27 ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
services.grocy = {
enable = true;
hostName = "localhost";

@ -5,7 +5,7 @@ import ./make-test-python.nix ({ lib, ... }: {
maintainers = [ rnhmjoj ];
};
machine = { ... }: {
nodes.machine = { ... }: {
virtualisation.useBootLoader = true;
boot.loader.timeout = null;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... } : {
maintainers = [ joachifm ];
};
machine =
nodes.machine =
{ lib, pkgs, config, ... }:
with lib;
{ users.users.alice = { isNormalUser = true; extraGroups = [ "proc" ]; };

@ -5,7 +5,7 @@ import ./make-test-python.nix ({ lib, ...} : {
maintainers = with lib.maintainers; [ thibautmarty ];
};
machine = { pkgs, lib, ... }: {
nodes.machine = { pkgs, lib, ... }: {
imports = [ ./common/x11.nix ./common/user-account.nix ];
test-support.displayManager.auto.user = "alice";
services.xserver.displayManager.defaultSession = lib.mkForce "none+herbstluftwm";

@ -39,7 +39,7 @@ in makeTest {
nodes = {
# System configuration used for installing the installedConfig from above.
machine = { config, lib, pkgs, ... }: with lib; {
nodes.machine = { config, lib, pkgs, ... }: with lib; {
imports = [
../modules/profiles/installation-device.nix
../modules/profiles/base.nix

@ -4,7 +4,7 @@ import ../make-test-python.nix ({ pkgs, ... }:
meta = with pkgs.lib.maintainers; {
maintainers = [ jflanglois ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
environment.systemPackages = [ pkgs.curl ];
services.hitch = {
enable = true;

@ -5,7 +5,7 @@ import ../make-test-python.nix ({ pkgs, ...} : {
broken = true; # tries to download from registry-1.docker.io - how did this ever work?
};
machine = import ./machine.nix;
nodes.machine = import ./machine.nix;
testScript = ''
start_all()

@ -24,7 +24,7 @@ in {
name = "hockeypuck";
meta.maintainers = with lib.maintainers; [ etu ];
machine = { ... }: {
nodes.machine = { ... }: {
# Used for test
environment.systemPackages = [ pkgs.gnupg ];

@ -20,7 +20,7 @@ let
maintainers = [ primeos blitz ];
};
machine = { lib, ... }: {
nodes.machine = { lib, ... }: {
networking.hostName = hostName;
networking.domain = domain;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... } : {
meta = with pkgs.lib.maintainers; {
maintainers = [ grahamc ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
services.hound = {
enable = true;
config = ''

@ -20,7 +20,7 @@ let
maintainers = [ lewo ma27 ];
};
machine = { pkgs, lib, ... }: {
nodes.machine = { pkgs, lib, ... }: {
imports = [ baseConfig ];
services.hydra = { inherit package; };
};

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
maintainers = [ aszlig ];
};
machine = { lib, ... }: {
nodes.machine = { lib, ... }: {
imports = [ ./common/x11.nix ./common/user-account.nix ];
test-support.displayManager.auto.user = "alice";
services.xserver.displayManager.defaultSession = lib.mkForce "none+i3";

@ -7,7 +7,7 @@ let
inherit (import ../../lib/testing-python.nix { inherit system pkgs; }) makeTest;
f = backend: makeTest {
name = "ihatemoney-${backend}";
machine = { nodes, lib, ... }: {
nodes.machine = { nodes, lib, ... }: {
services.ihatemoney = {
enable = true;
enablePublicProjectCreation = true;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
name = "incron";
meta.maintainers = [ lib.maintainers.aanderse ];
machine =
nodes.machine =
{ ... }:
{ services.incron.enable = true;
services.incron.extraPackages = [ pkgs.coreutils ];

@ -3,7 +3,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
meta.maintainers = [ pkgs.lib.maintainers.eelco ];
machine = { ... }: {
nodes.machine = { ... }: {
imports = [ ../modules/profiles/minimal.nix ];
boot.initrd.network.enable = true;
boot.initrd.network.postCommands =

@ -11,7 +11,7 @@ let
meta.maintainers = [ lib.maintainers.lheckemann ];
machine = { ... }: {
nodes.machine = { ... }: {
virtualisation.useBootLoader = true;
boot.initrd.secrets = {
"/test" = secretInStore;

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
maintainers = with pkgs.lib.maintainers; [ LunNova ];
};
machine = { config, ... }:
nodes.machine = { config, ... }:
let user = config.users.users.sybil; in
{
imports = [

@ -43,7 +43,7 @@ let
maintainers = tested.meta.maintainers;
};
machine = { ... }: {
nodes.machine = { ... }: {
imports = [
testConfig
] ++ optional withX11 ../common/x11.nix;

@ -5,7 +5,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = [ sbruder ];
};
machine = { config, lib, pkgs, ... }: {
nodes.machine = { config, lib, pkgs, ... }: {
services.invidious = {
enable = true;
};

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = [ asbachb ];
};
machine = { config, pkgs, ... }: {
nodes.machine = { config, pkgs, ... }: {
services.isso = {
enable = true;
settings = {

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }:
name = "jellyfin";
meta.maintainers = with lib.maintainers; [ minijackson ];
machine =
nodes.machine =
{ ... }:
{
services.jellyfin.enable = true;

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
maintainers = teams.jitsi.members;
};
machine = { config, pkgs, ... }: {
nodes.machine = { config, pkgs, ... }: {
virtualisation.memorySize = 5120;
services.jitsi-meet = {

@ -38,7 +38,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
maintainers = [ euank ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
environment.systemPackages = with pkgs; [ k3s gzip ];
# k3s uses enough resources the default vm fails.

@ -38,7 +38,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
maintainers = [ euank ];
};
machine = { pkgs, ... }: {
nodes.machine = { pkgs, ... }: {
environment.systemPackages = with pkgs; [ k3s gzip ];
# k3s uses enough resources the default vm fails.

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }:
meta.maintainers = with lib.maintainers; [ oxalica ];
machine = { ... }: {};
nodes.machine = { ... }: {};
testScript = ''
machine.succeed("gzip -cd ${pkgs.terminus_font}/share/consolefonts/ter-v16b.psf.gz >font.psf")

@ -1,7 +1,7 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "kbd-update-search-paths-patch";
machine = { pkgs, options, ... }: {
nodes.machine = { pkgs, options, ... }: {
console = {
packages = options.console.packages.default ++ [ pkgs.terminus_font ];
};

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, ...} :
maintainers = [ turion ];
};
machine = { ... }:
nodes.machine = { ... }:
{
imports = [

@ -1,6 +1,6 @@
import ../make-test-python.nix ({pkgs, ...}: {
name = "kerberos_server-heimdal";
machine = { config, libs, pkgs, ...}:
nodes.machine = { config, libs, pkgs, ...}:
{ services.kerberos_server =
{ enable = true;
realms = {

@ -1,6 +1,6 @@
import ../make-test-python.nix ({pkgs, ...}: {
name = "kerberos_server-mit";
machine = { config, libs, pkgs, ...}:
nodes.machine = { config, libs, pkgs, ...}:
{ services.kerberos_server =
{ enable = true;
realms = {

@ -12,7 +12,7 @@ let
maintainers = [ nequissimus atemu ];
};
machine = { ... }:
nodes.machine = { ... }:
{
boot.kernelPackages = linuxPackages;
};

@ -4,7 +4,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
maintainers = [ veehaitch ];
};
machine = { pkgs, ... }:
nodes.machine = { pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.wireless.athUserRegulatoryDomain = true;

@ -6,7 +6,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
maintainers = [ eelco ];
};
machine = { ... }:
nodes.machine = { ... }:
{ virtualisation.vlans = [ ]; };
testScript =

@ -7,7 +7,7 @@ import ../make-test-python.nix ({ pkgs, ...} : {
maintainers = [ eqyiel ];
};
machine =
nodes.machine =
{ ... }: {
krb5 = {
enable = true;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save