I wish to change the system date to prepare an webapp for daylight savings.
I don't think this is possible.
#( 03/29/19@ 9:32 )( jappie@portable-jappie-nixos ):~
sudo timedatectl set-time '2019-04-01'
[sudo] wachtwoord voor jappie:
Failed to set time: Automatic time synchronization is enabled
#( 03/29/19@ 9:32 )( jappie@portable-jappie-nixos ):~
sudo timedatectl set-ntp false
Failed to set ntp: Changing system settings via systemd is not supported on NixOS.
I expect to be able to disable ntp so that I can change the system date.
Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.
"x86_64-linux"Linux 4.14.103, NixOS, 18.09.2253.753f58d9a42 (Jellyfish)yesyesnix-env (Nix) 2.1.3"nixos-18.09.2266.aabc61049c0, nixos-18.09-18.09.2266.aabc61049c0"""/nix/var/nix/profiles/per-user/root/channels/nixosNot sure why this needs to be disabled, ping @gebner who authored this in https://github.com/NixOS/systemd/commit/f65b136cc06
You can read the history here: https://github.com/NixOS/systemd/pull/2
This wasn't really my idea. Before my PR, the timedatectl executable wasn't even compiled---precisely because some commands could change the system state. I just wanted to run timedatectl status. So I disabled the set-time etc. features because I didn't want to start a long discussion about whether these features should available or not.
I see, but I don't see any way to actually set the time then, there's no NixOS option for it, and I have no idea how one could be implemented..
systemctl stop systemd-timesyncd.service
date --set="10:00:00"
seems to work for me.
Heh, now I'm not sure what I expected, because it doesn't make sense to set the date from a NixOS config. I guess for a permanent solution you'll just have to disable that service.
Thanks @symphorien that'll work for my use case.
Github now says this discussion happened 3 days ago, so it works!
Most helpful comment
seems to work for me.