mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 21:25:30 +03:00
Add option to keep hardware clock in local time.
This commit is contained in:
parent
5412b1089f
commit
008493f94c
2 changed files with 13 additions and 7 deletions
|
@ -5,13 +5,19 @@ with pkgs.lib;
|
|||
{
|
||||
options = {
|
||||
|
||||
time.timeZone = mkOption {
|
||||
default = "CET";
|
||||
type = with types; uniq string;
|
||||
example = "America/New_York";
|
||||
description = "The time zone used when displaying times and dates.";
|
||||
};
|
||||
time = {
|
||||
timeZone = mkOption {
|
||||
default = "CET";
|
||||
type = with types; uniq string;
|
||||
example = "America/New_York";
|
||||
description = "The time zone used when displaying times and dates.";
|
||||
};
|
||||
|
||||
clockLocal = mkOption {
|
||||
default = false;
|
||||
description = "Keep the Hardware Clock in local time instead of UTC";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
|
@ -73,7 +73,7 @@ with pkgs.lib;
|
|||
|
||||
# Set the hardware clock to the system time.
|
||||
echo "setting the hardware clock..."
|
||||
hwclock --systohc --utc
|
||||
hwclock --systohc ${if config.time.clockLocal then "--localtime" else "--utc"}
|
||||
|
||||
|
||||
# Stop all swap devices.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue