From d5d323a907b0ff04ec0b78fbf35d96ea270cafc5 Mon Sep 17 00:00:00 2001 From: DavHau Date: Sat, 24 May 2025 13:34:38 +0700 Subject: [PATCH] emergencyMode, emergencyAccess: cross reference options in docs. I was confused why I could not get an emergency access console despite setting systemd.emergencyMode=true. Turns out there is another similar option `boot.initrd.systemd.emergencyAccess` that I should have used. This is confusing and this change should make it more clear vie the docs of both these options. --- nixos/modules/system/boot/emergency-mode.nix | 9 ++++++++- nixos/modules/system/boot/systemd/initrd.nix | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/emergency-mode.nix b/nixos/modules/system/boot/emergency-mode.nix index 34058bc17a6b..ec4e39a9a59e 100644 --- a/nixos/modules/system/boot/emergency-mode.nix +++ b/nixos/modules/system/boot/emergency-mode.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + config, + lib, + options, + ... +}: { ###### interface @@ -15,6 +20,8 @@ instances) have no console of any kind, emergency mode doesn't make sense, and it's better to continue with the boot insofar as possible. + + For initrd emergency access, use ${options.boot.initrd.systemd.emergencyAccess} instead. ''; }; diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index 65caee745124..fd081d44cbd8 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -266,6 +266,8 @@ in Can also be set to a hashed super user password to allow authenticated access to the emergency mode. + + For emergency access after initrd, use `${options.systemd.enableEmergencyMode}` instead. ''; default = false; };