summary refs log tree commit diff
path: root/nixos/modules/config/timezone.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-01-06 18:23:41 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-01-06 18:23:41 +0100
commit1b5e860f65607b4cc7de4b6b5db95460cf144526 (patch)
treecac5cfb1dda810921963d3749d87a54407b84177 /nixos/modules/config/timezone.nix
parent393b2e3b19507d5df734be144cb29c59d989650e (diff)
downloadnixlib-1b5e860f65607b4cc7de4b6b5db95460cf144526.tar
nixlib-1b5e860f65607b4cc7de4b6b5db95460cf144526.tar.gz
nixlib-1b5e860f65607b4cc7de4b6b5db95460cf144526.tar.bz2
nixlib-1b5e860f65607b4cc7de4b6b5db95460cf144526.tar.lz
nixlib-1b5e860f65607b4cc7de4b6b5db95460cf144526.tar.xz
nixlib-1b5e860f65607b4cc7de4b6b5db95460cf144526.tar.zst
nixlib-1b5e860f65607b4cc7de4b6b5db95460cf144526.zip
Make /etc/localtime a direct symlink to the zoneinfo file
Some programs (notably the Java Runtime Environment) expect to be able
to extract the name of the time zone from the target of the
/etc/localtime symlink.  That doesn't work if /etc/localtime is a
symlink to /etc/static/localtime.  So make it a direct symlink.
Diffstat (limited to 'nixos/modules/config/timezone.nix')
-rw-r--r--nixos/modules/config/timezone.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/config/timezone.nix b/nixos/modules/config/timezone.nix
index 07a76d9ad1fa..979778046fda 100644
--- a/nixos/modules/config/timezone.nix
+++ b/nixos/modules/config/timezone.nix
@@ -27,7 +27,10 @@ with pkgs.lib;
     environment.variables.TZDIR = "/etc/zoneinfo";
     environment.variables.TZ = config.time.timeZone;
 
-    environment.etc.localtime.source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}";
+    environment.etc.localtime =
+      { source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}";
+        mode = "direct-symlink";
+      };
 
     environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo";