mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 02:44:30 +00:00
nixos/automatic-timezoned: set time.timeZone
to null
to avoid silent overriding (#347217)
This commit is contained in:
commit
b1e4854ecb
@ -685,6 +685,9 @@
|
||||
|
||||
- ZFS now imports its pools in `postResumeCommands` rather than `postDeviceCommands`. If you had `postDeviceCommands` scripts that depended on ZFS pools being imported, those now need to be in `postResumeCommands`.
|
||||
|
||||
- `services.automatic-timezoned.enable = true` will now set `time.timeZone = null`.
|
||||
This is to avoid silently shadowing a user's explicitly defined timezone without recognition on the user's part.
|
||||
|
||||
- `services.localtimed.enable = true` will now set `time.timeZone = null`.
|
||||
This is to avoid silently shadowing a user's explicitly defined timezone without recognition on the user's part.
|
||||
|
||||
|
@ -16,6 +16,11 @@ in
|
||||
timezone up-to-date based on the current location. It uses geoclue2 to
|
||||
determine the current location and systemd-timedated to actually set
|
||||
the timezone.
|
||||
|
||||
To avoid silent overriding by the service, if you have explicitly set a
|
||||
timezone, either remove it or ensure that it is set with a lower priority
|
||||
than the default value using `lib.mkDefault` or `lib.mkOverride`. This is
|
||||
to make the choice deliberate. An error will be presented otherwise.
|
||||
'';
|
||||
};
|
||||
package = mkPackageOption pkgs "automatic-timezoned" { };
|
||||
@ -23,6 +28,10 @@ in
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# This will give users an error if they have set an explicit time
|
||||
# zone, rather than having the service silently override it.
|
||||
time.timeZone = null;
|
||||
|
||||
security.polkit.extraConfig = ''
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (action.id == "org.freedesktop.timedate1.set-timezone"
|
||||
|
Loading…
Reference in New Issue
Block a user