From ce822289c31c245aa79c30cae92b044b5072caf4 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 27 Oct 2011 19:36:03 +0000 Subject: [PATCH] * Create /etc/localtime as a symlink to the right zoneinfo file. However, this won't do anything until we merge the stdenv branch. svn path=/nixos/trunk/; revision=30071 --- modules/config/timezone.nix | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/modules/config/timezone.nix b/modules/config/timezone.nix index b08712464a1..59b4a917ebc 100644 --- a/modules/config/timezone.nix +++ b/modules/config/timezone.nix @@ -1,10 +1,11 @@ -{pkgs, config, ...}: +{ config, pkgs, ... }: -let +with pkgs.lib; +{ options = { - time.timeZone = pkgs.lib.mkOption { + time.timeZone = mkOption { default = "CET"; example = "America/New_York"; description = "The time zone used when displaying times and dates."; @@ -12,14 +13,19 @@ let }; -in + config = { -{ - require = [options]; + environment.shellInit = + '' + export TZ=${config.time.timeZone} + export TZDIR=${pkgs.glibc}/share/zoneinfo + ''; - environment.shellInit = - '' - export TZ=${config.time.timeZone} - export TZDIR=${pkgs.glibc}/share/zoneinfo - ''; + environment.etc = singleton + { source = "${pkgs.glibc}/share/zoneinfo/${config.time.timeZone}"; + target = "localtime"; + }; + + }; + }