2012-06-19 00:15:34 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
# This unit saves the value of the system clock to the hardware
|
|
|
|
# clock on shutdown.
|
2013-01-16 12:33:18 +01:00
|
|
|
systemd.units."save-hwclock.service" =
|
2012-06-19 00:15:34 +02:00
|
|
|
{ wantedBy = [ "shutdown.target" ];
|
|
|
|
|
|
|
|
text =
|
|
|
|
''
|
|
|
|
[Unit]
|
|
|
|
Description=Save Hardware Clock
|
|
|
|
DefaultDependencies=no
|
|
|
|
Before=shutdown.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2012-07-16 23:32:26 +02:00
|
|
|
ExecStart=${pkgs.utillinux}/sbin/hwclock --systohc ${if config.time.hardwareClockInLocalTime then "--localtime" else "--utc"}
|
2012-06-19 00:15:34 +02:00
|
|
|
'';
|
|
|
|
};
|
2012-08-14 22:45:50 +02:00
|
|
|
|
2013-03-27 17:20:41 +01:00
|
|
|
boot.kernel.sysctl."kernel.poweroff_cmd" = "${config.systemd.package}/sbin/poweroff";
|
|
|
|
|
2012-06-19 00:15:34 +02:00
|
|
|
}
|