feat(nixos): open the initrd emergency shell with the root password

Assisted-by: DeepSeek Harness (claude-opus-5-5)
This commit is contained in:
Ryan Yin committed 2026-11-17 21:05:20 +08:00
1 parent f76889a158
commit 044e8c5a2a
3 files changed
+18 -1

No files matched your search

+9 -1
View File
@@ -9,7 +9,12 @@ let
inherit (networking.hostsAddr.${hostName}) iface ipv4;
ipv4WithMask = "${ipv4}/24";
in
{ config, lib, ... }:
{
config,
lib,
myvars,
...
}:
{
# CPU policy belongs to physical hosts; guests do not control hardware frequency.
imports = [
@@ -34,6 +39,9 @@ in
# Retries need no console: root LUKS unlocks through TPM2 alone (hosts/README.md).
boot.loader.systemd-boot.bootCounting.enable = true;
# A failed initrd drops to a root shell behind the root password (docs/SECURITY.md).
boot.initrd.systemd.emergencyAccess = myvars.initialHashedPassword;
# KVM for the microVMs and the libvirt domains. AMD-specific: an Intel VM host
# would need kvm-intel instead (see hosts/idols-ai/hardware-intel.nix).
boot.kernelModules = [ "kvm-amd" ];