dotfiles/modules/nixos/system/timezone.nix

30 lines
730 B
Nix
Raw Permalink Normal View History

2024-04-20 09:42:06 -04:00
{
config,
pkgs,
lib,
...
}:
{
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
config = lib.mkIf pkgs.stdenv.isLinux {
2022-04-25 21:54:53 -04:00
2022-12-21 14:18:03 -07:00
# Service to determine location for time zone
services.geoclue2.enable = true;
services.geoclue2.enableWifi = false; # Breaks when it can't connect
2024-04-20 09:42:06 -04:00
location = {
provider = "geoclue2";
};
2022-06-05 08:32:23 -04:00
2022-12-21 14:18:03 -07:00
# Enable local time based on time zone
services.localtimed.enable = true;
# Required to get localtimed to talk to geoclue2
services.geoclue2.appConfig.localtimed.isSystem = true;
services.geoclue2.appConfig.localtimed.isAllowed = true;
2023-03-27 13:45:23 -04:00
# Fix "Failed to set timezone"
# https://github.com/NixOS/nixpkgs/issues/68489#issuecomment-1484030107
services.geoclue2.enableDemoAgent = lib.mkForce true;
2022-12-21 14:18:03 -07:00
};
2022-04-25 21:54:53 -04:00
}