From 945849b86fe33474da569b307d7e5880877491b6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 22 Apr 2013 18:56:19 +0200 Subject: [PATCH] Don't set $TZ We don't need to set $TZ, because we have /etc/localtime. In fact, setting $TZ without $TZDIR doesn't work anymore since Glibc no longer contains zone info. --- modules/config/timezone.nix | 9 ++++----- modules/services/databases/postgresql.nix | 5 +---- modules/services/logging/logstash.nix | 1 - modules/services/logging/rsyslogd.nix | 2 -- modules/services/logging/syslogd.nix | 2 -- modules/services/mail/postfix.nix | 2 -- modules/services/mail/spamassassin.nix | 1 - modules/services/monitoring/smartd.nix | 2 -- modules/services/network-filesystems/samba.nix | 1 - modules/services/scheduling/cron.nix | 6 ------ modules/services/web-servers/apache-httpd/default.nix | 1 - modules/services/web-servers/tomcat.nix | 2 -- modules/services/x11/xserver.nix | 1 - 13 files changed, 5 insertions(+), 30 deletions(-) diff --git a/modules/config/timezone.nix b/modules/config/timezone.nix index f21a1ec5d4c2..9de19078c103 100644 --- a/modules/config/timezone.nix +++ b/modules/config/timezone.nix @@ -6,7 +6,7 @@ with pkgs.lib; options = { time = { - + timeZone = mkOption { default = "CET"; type = with types; uniq string; @@ -18,7 +18,7 @@ with pkgs.lib; default = false; description = "If set, keep the hardware clock in local time instead of UTC."; }; - + }; }; @@ -26,7 +26,6 @@ with pkgs.lib; environment.shellInit = '' - export TZ=${config.time.timeZone} export TZDIR=${pkgs.tzdata}/share/zoneinfo ''; @@ -34,7 +33,7 @@ with pkgs.lib; { source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}"; target = "localtime"; }; - + }; - + } diff --git a/modules/services/databases/postgresql.nix b/modules/services/databases/postgresql.nix index 61f69dfd34a9..2926bc62940b 100644 --- a/modules/services/databases/postgresql.nix +++ b/modules/services/databases/postgresql.nix @@ -161,10 +161,7 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - environment = - { TZ = config.time.timeZone; - PGDATA = cfg.dataDir; - }; + environment.PGDATA = cfg.dataDir; path = [ pkgs.su postgresql ]; diff --git a/modules/services/logging/logstash.nix b/modules/services/logging/logstash.nix index b535a942a9e8..2f0eea505267 100644 --- a/modules/services/logging/logstash.nix +++ b/modules/services/logging/logstash.nix @@ -140,7 +140,6 @@ in description = "Logstash daemon"; wantedBy = [ "multi-user.target" ]; - environment.TZ = config.time.timeZone; path = [ jre ]; diff --git a/modules/services/logging/rsyslogd.nix b/modules/services/logging/rsyslogd.nix index 03fe50ab915c..680c7a912c1f 100644 --- a/modules/services/logging/rsyslogd.nix +++ b/modules/services/logging/rsyslogd.nix @@ -92,8 +92,6 @@ in wantedBy = [ "multi-user.target" ]; - environment.TZ = config.time.timeZone; - serviceConfig = { ExecStart = "${pkgs.rsyslog}/sbin/rsyslogd ${toString cfg.extraParams} -f ${syslogConf} -n"; ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/spool/rsyslog"; diff --git a/modules/services/logging/syslogd.nix b/modules/services/logging/syslogd.nix index c45b533112a8..24cd5c1567e7 100644 --- a/modules/services/logging/syslogd.nix +++ b/modules/services/logging/syslogd.nix @@ -112,8 +112,6 @@ in wantedBy = [ "multi-user.target" ]; - environment.TZ = config.time.timeZone; - serviceConfig = { ExecStart = "${pkgs.sysklogd}/sbin/syslogd ${toString cfg.extraParams} -f ${syslogConf} -n"; # Prevent syslogd output looping back through journald. diff --git a/modules/services/mail/postfix.nix b/modules/services/mail/postfix.nix index 6b141e7e24ec..2633289b46d5 100644 --- a/modules/services/mail/postfix.nix +++ b/modules/services/mail/postfix.nix @@ -369,8 +369,6 @@ in daemonType = "fork"; - environment.TZ = config.time.timeZone; - preStart = '' if ! [ -d /var/spool/postfix ]; then diff --git a/modules/services/mail/spamassassin.nix b/modules/services/mail/spamassassin.nix index d0029c1256c1..aaf1dfcc210c 100644 --- a/modules/services/mail/spamassassin.nix +++ b/modules/services/mail/spamassassin.nix @@ -56,7 +56,6 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - environment.TZ = config.time.timeZone; exec = "${pkgs.spamassassin}/bin/spamd ${optionalString cfg.debug "-D"} --username=spamd --groupname=spamd --nouser-config --virtual-config-dir=/var/lib/spamassassin/user-%u --allow-tell --pidfile=/var/run/spamd.pid"; }; diff --git a/modules/services/monitoring/smartd.nix b/modules/services/monitoring/smartd.nix index 3f065666ea29..de07dc0dbaa6 100644 --- a/modules/services/monitoring/smartd.nix +++ b/modules/services/monitoring/smartd.nix @@ -107,8 +107,6 @@ in systemd.services.smartd = { description = "S.M.A.R.T. Daemon"; - environment.TZ = config.time.timeZone; - wantedBy = [ "multi-user.target" ]; serviceConfig.ExecStart = "${pkgs.smartmontools}/sbin/smartd --no-fork ${smartdFlags}"; diff --git a/modules/services/network-filesystems/samba.nix b/modules/services/network-filesystems/samba.nix index c4157c647c63..903e2c39ae9c 100644 --- a/modules/services/network-filesystems/samba.nix +++ b/modules/services/network-filesystems/samba.nix @@ -64,7 +64,6 @@ let environment = { LD_LIBRARY_PATH = nssModulesPath; - TZ = config.time.timeZone; LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }; diff --git a/modules/services/scheduling/cron.nix b/modules/services/scheduling/cron.nix index 9aa9213556d1..e14f03fb1e83 100644 --- a/modules/services/scheduling/cron.nix +++ b/modules/services/scheduling/cron.nix @@ -90,12 +90,6 @@ in startOn = "startup"; - # Needed to interpret times in the local timezone. - environment = { - TZ = config.time.timeZone; - TZDIR = "${pkgs.tzdata}/share/zoneinfo"; - }; - path = [ cronNixosPkg ]; preStart = diff --git a/modules/services/web-servers/apache-httpd/default.nix b/modules/services/web-servers/apache-httpd/default.nix index 35afacefa164..b66f6d7cd1da 100644 --- a/modules/services/web-servers/apache-httpd/default.nix +++ b/modules/services/web-servers/apache-httpd/default.nix @@ -618,7 +618,6 @@ in environment = { PHPRC = if enablePHP then phpIni else ""; - TZ = config.time.timeZone; } // (listToAttrs (concatMap (svc: svc.globalEnvVars) allSubservices)); preStart = diff --git a/modules/services/web-servers/tomcat.nix b/modules/services/web-servers/tomcat.nix index b836b8c5f7d5..a68828de5d8e 100644 --- a/modules/services/web-servers/tomcat.nix +++ b/modules/services/web-servers/tomcat.nix @@ -119,8 +119,6 @@ in startOn = "started network-interfaces"; stopOn = "stopping network-interfaces"; - environment = { TZ = config.time.timeZone; }; - preStart = '' # Create the base directory diff --git a/modules/services/x11/xserver.nix b/modules/services/x11/xserver.nix index 30e4c5cdc935..59e8a56982a7 100644 --- a/modules/services/x11/xserver.nix +++ b/modules/services/x11/xserver.nix @@ -461,7 +461,6 @@ in environment = { FONTCONFIG_FILE = "/etc/fonts/fonts.conf"; # !!! cleanup XKB_BINDIR = "${xorg.xkbcomp}/bin"; # Needed for the Xkb extension. - TZ = config.time.timeZone; } # !!! Depends on the driver selected at runtime. // optionalAttrs (!elem "nvidia" driverNames) { XORG_DRI_DRIVER_PATH = "${pkgs.mesa}/lib/dri";