1 { config, lib, pkgs, ... }:
7 # This unit saves the value of the system clock to the hardware
9 systemd.services.save-hwclock =
10 { description = "Save Hardware Clock";
12 wantedBy = [ "shutdown.target" ];
15 DefaultDependencies = false;
16 ConditionPathExists = "/dev/rtc";
21 ExecStart = "${pkgs.util-linux}/sbin/hwclock --systohc ${if config.time.hardwareClockInLocalTime then "--localtime" else "--utc"}";
25 boot.kernel.sysctl."kernel.poweroff_cmd" = "${config.systemd.package}/sbin/poweroff";