Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.

timedated: allow setting timezone #13

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/timedate/timedated.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,9 @@ static int method_set_timezone(sd_bus_message *m, void *userdata, sd_bus_error *
if (r < 0)
return r;

return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED,
"Changing system settings via systemd is not supported on NixOS.");
if (getenv("NIXOS_STATIC_TIMEZONE"))
return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED,
"Changing timezone via systemd is not supported when it is set in NixOS configuration.");

if (!timezone_is_valid(z))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid time zone '%s'", z);
Expand Down