diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md
index 62da4f33d81..99704ec3c14 100644
--- a/nixos/doc/manual/development/writing-nixos-tests.section.md
+++ b/nixos/doc/manual/development/writing-nixos-tests.section.md
@@ -70,20 +70,9 @@ nix-build -A nixosTests.hostname
Outside the `nixpkgs` repository, you can instantiate the test by first importing the NixOS library,
```nix
-# regular nix
let nixos-lib = import (nixpkgs + "/nixos/lib") { };
in
-```
-```nix
-# flake
-let nixos-lib = nixpkgs.lib.nixos;
-in
-```
-
-... and then invoking `runTest`, for example:
-
-```nix
nixos-lib.runTest {
imports = [ ./test.nix ];
hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs
diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml
index 6e27845b598..32f5fdb77f5 100644
--- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml
+++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml
@@ -88,19 +88,9 @@ nix-build -A nixosTests.hostname
instantiate the test by first importing the NixOS library,
-# regular nix
let nixos-lib = import (nixpkgs + "/nixos/lib") { };
in
-
-
-# flake
-let nixos-lib = nixpkgs.lib.nixos;
-in
-
-
- … and then invoking runTest, for example:
-
-
+
nixos-lib.runTest {
imports = [ ./test.nix ];
hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs