summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-03-18 23:14:34 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-03-18 23:14:34 +0100
commit7d8fea797a4a844c6715a4f8a0a70f86df96bf5a (patch)
treeb328dccba2555847952e6d1f0696b285fc727ffa /nixos
parent08095f97ce88962c365781ffa1692aadc03a8de8 (diff)
downloadnixpkgs-7d8fea797a4a844c6715a4f8a0a70f86df96bf5a.tar
nixpkgs-7d8fea797a4a844c6715a4f8a0a70f86df96bf5a.tar.gz
nixpkgs-7d8fea797a4a844c6715a4f8a0a70f86df96bf5a.tar.bz2
nixpkgs-7d8fea797a4a844c6715a4f8a0a70f86df96bf5a.tar.lz
nixpkgs-7d8fea797a4a844c6715a4f8a0a70f86df96bf5a.tar.xz
nixpkgs-7d8fea797a4a844c6715a4f8a0a70f86df96bf5a.tar.zst
nixpkgs-7d8fea797a4a844c6715a4f8a0a70f86df96bf5a.zip
Run hwclock --hctosys to initialize the system time
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/kernel.nix3
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh6
2 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix
index 327f3b7e112..4cfd8a0b618 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 9b3cfc9e7a5..4a86daf1fe8 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