diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index 327f3b7e1128..4cfd8a0b6187 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -203,6 +203,9 @@ in # To wait for SCSI devices to appear. "scsi_wait_scan" + + # Needed by the stage 2 init script. + "rtc_cmos" ]; boot.initrd.kernelModules = diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh index 9b3cfc9e7a56..4a86daf1fe80 100644 --- a/nixos/modules/system/boot/stage-2-init.sh +++ b/nixos/modules/system/boot/stage-2-init.sh @@ -161,6 +161,12 @@ echo "running activation script..." $systemConfig/activate +# Restore the system time from the hardware clock. We do this after +# running the activation script to be sure that /etc/localtime points +# at the current time zone. +hwclock --hctosys + + # Record the boot configuration. ln -sfn "$systemConfig" /run/booted-system