12 # This unit saves the value of the system clock to the hardware
14 systemd.services.save-hwclock = {
15 description = "Save Hardware Clock";
17 wantedBy = [ "shutdown.target" ];
20 DefaultDependencies = false;
21 ConditionPathExists = "/dev/rtc";
22 ConditionPathIsReadWrite = "/etc/";
27 ExecStart = "${pkgs.util-linux}/sbin/hwclock --systohc ${
28 if config.time.hardwareClockInLocalTime then "--localtime" else "--utc"
33 boot.kernel.sysctl."kernel.poweroff_cmd" = "${config.systemd.package}/sbin/poweroff";