mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-12-03 03:03:59 +01:00
feat(nixos): open the initrd emergency shell with the root password
Assisted-by: DeepSeek Harness (claude-opus-5-5)
This commit is contained in:
1 parent
f76889a158
commit
044e8c5a2a
3 files changed
+18
-1
No files matched your search
@@ -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" ];
|
||||
|
||||
Reference in new issue
Block a user