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.
|
|
|
|
boot.systemd.units."save-hwclock.service" =
|
|
|
|
{ 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
|
|
|
|
2012-06-19 00:15:34 +02:00
|
|
|
}
|