2012-06-18 22:15:34 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
# This unit saves the value of the system clock to the hardware
|
|
|
|
# clock on shutdown.
|
2013-11-26 17:17:12 +00:00
|
|
|
systemd.services.save-hwclock =
|
|
|
|
{ description = "Save Hardware Clock";
|
|
|
|
|
|
|
|
wantedBy = [ "shutdown.target" ];
|
|
|
|
|
|
|
|
unitConfig = {
|
|
|
|
DefaultDependencies = false;
|
|
|
|
ConditionVirtualization = "!systemd-nspawn";
|
|
|
|
};
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = "${pkgs.utillinux}/sbin/hwclock --systohc ${if config.time.hardwareClockInLocalTime then "--localtime" else "--utc"}";
|
|
|
|
};
|
2012-06-18 22:15:34 +00:00
|
|
|
};
|
2012-08-14 20:45:50 +00:00
|
|
|
|
2013-03-27 16:20:41 +00:00
|
|
|
boot.kernel.sysctl."kernel.poweroff_cmd" = "${config.systemd.package}/sbin/poweroff";
|
|
|
|
|
2012-06-18 22:15:34 +00:00
|
|
|
}
|