about summary refs log tree commit diff
path: root/nixos/modules/testing
diff options
context:
space:
mode:
authornikstur <nikstur@outlook.com>2023-11-19 01:25:52 +0100
committernikstur <nikstur@outlook.com>2024-01-18 23:08:13 +0100
commit4b128008c5d9fde881ce1b0a25e60ae0415a14d5 (patch)
tree761bc09a9f4b35cdb9e9cf53e3c5f07168ebb1d5 /nixos/modules/testing
parentc980ca60582336e36450e888745a946286aae060 (diff)
downloadnixlib-4b128008c5d9fde881ce1b0a25e60ae0415a14d5.tar
nixlib-4b128008c5d9fde881ce1b0a25e60ae0415a14d5.tar.gz
nixlib-4b128008c5d9fde881ce1b0a25e60ae0415a14d5.tar.bz2
nixlib-4b128008c5d9fde881ce1b0a25e60ae0415a14d5.tar.lz
nixlib-4b128008c5d9fde881ce1b0a25e60ae0415a14d5.tar.xz
nixlib-4b128008c5d9fde881ce1b0a25e60ae0415a14d5.tar.zst
nixlib-4b128008c5d9fde881ce1b0a25e60ae0415a14d5.zip
nixos/test-instrumentation: use file to set root password
Diffstat (limited to 'nixos/modules/testing')
-rw-r--r--nixos/modules/testing/test-instrumentation.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix
index 9ee77cd79a9b..6aa718c1975d 100644
--- a/nixos/modules/testing/test-instrumentation.nix
+++ b/nixos/modules/testing/test-instrumentation.nix
@@ -207,7 +207,10 @@ in
     networking.usePredictableInterfaceNames = false;
 
     # Make it easy to log in as root when running the test interactively.
-    users.users.root.initialHashedPassword = mkOverride 150 "";
+    # This needs to be a file because of a quirk in systemd credentials,
+    # where you cannot specify an empty string as a value. systemd-sysusers
+    # uses credentials to set passwords on users.
+    users.users.root.hashedPasswordFile = mkOverride 150 "${pkgs.writeText "hashed-password.root" ""}";
 
     services.xserver.displayManager.job.logToJournal = true;