diff --git a/nixos/doc/manual/development/writing-nixos-tests.xml b/nixos/doc/manual/development/writing-nixos-tests.xml
index 7b25a39e83b..a8f6aa00858 100644
--- a/nixos/doc/manual/development/writing-nixos-tests.xml
+++ b/nixos/doc/manual/development/writing-nixos-tests.xml
@@ -272,8 +272,37 @@ startAll;
+
+ systemctl
+
+ Runs systemctl commands with optional support for
+ systemctl --user
+
+
+ $machine->systemctl("list-jobs --no-pager"); // runs `systemctl list-jobs --no-pager`
+ $machine->systemctl("list-jobs --no-pager", "any-user"); // spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager`
+
+
+
+
+
+
+ To test user units declared by systemd.user.services the optional $user
+ argument can be used:
+
+
+ $machine->start;
+ $machine->waitForX;
+ $machine->waitForUnit("xautolock.service", "x-session-user");
+
+
+ This applies to systemctl, getUnitInfo,
+ waitForUnit, startJob
+ and stopJob.
+
+
diff --git a/nixos/doc/manual/release-notes/rl-1803.xml b/nixos/doc/manual/release-notes/rl-1803.xml
index c8549e7c4ad..12ff2e39a1b 100644
--- a/nixos/doc/manual/release-notes/rl-1803.xml
+++ b/nixos/doc/manual/release-notes/rl-1803.xml
@@ -234,6 +234,13 @@ following incompatible changes:
to your configuration.nix.
+
+
+ The NixOS test driver supports user services declared by systemd.user.services.
+ The methods waitForUnit, getUnitInfo, startJob
+ and stopJob provide an optional $user argument for that purpose.
+
+