2012-06-18 23:15:34 +01: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 23:15:34 +01:00
|
|
|
{ wantedBy = [ "shutdown.target" ];
|
|
|
|
|
|
|
|
text =
|
|
|
|
''
|
|
|
|
[Unit]
|
|
|
|
Description=Save Hardware Clock
|
|
|
|
DefaultDependencies=no
|
|
|
|
Before=shutdown.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2012-07-16 22:32:26 +01:00
|
|
|
ExecStart=${pkgs.utillinux}/sbin/hwclock --systohc ${if config.time.hardwareClockInLocalTime then "--localtime" else "--utc"}
|
2012-06-18 23:15:34 +01:00
|
|
|
'';
|
|
|
|
};
|
2012-08-14 21:45:50 +01:00
|
|
|
|
2012-06-18 23:15:34 +01:00
|
|
|
}
|