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-01-16 11:33:18 +00:00
|
|
|
systemd.units."save-hwclock.service" =
|
2012-06-18 22:15:34 +00:00
|
|
|
{ wantedBy = [ "shutdown.target" ];
|
|
|
|
|
|
|
|
text =
|
|
|
|
''
|
|
|
|
[Unit]
|
|
|
|
Description=Save Hardware Clock
|
|
|
|
DefaultDependencies=no
|
|
|
|
Before=shutdown.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2012-07-16 21:32:26 +00:00
|
|
|
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
|
|
|
|
2012-06-18 22:15:34 +00:00
|
|
|
}
|