mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 13:43:22 +00:00
c3fb248bcb
The only thing that Upstart's shutdown job did that systemd doesn't do natively is update the hardware clock. So added a service for that.
26 lines
503 B
Nix
26 lines
503 B
Nix
{ 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
|
|
ExecStart=${pkgs.utillinux}/sbin/hwclock --systohc --utc
|
|
'';
|
|
};
|
|
|
|
}
|