system: set TZ=
authorJulien Moutinho <julm+julm-nix@sourcephile.fr>
Mon, 16 Jan 2023 14:22:54 +0000 (15:22 +0100)
committerJulien Moutinho <julm+julm-nix@sourcephile.fr>
Mon, 16 Jan 2023 15:20:29 +0000 (16:20 +0100)
nixos/profiles/system.nix

index a5f3206c8b77900acfbf42f9610053b8889d5e0a..30f534edaeb192c55a41b73f40e987725c27d28b 100644 (file)
@@ -1,4 +1,4 @@
-{ pkgs, lib, inputs, ... }:
+{ config, pkgs, lib, inputs, ... }:
 with lib;
 {
   boot.cleanTmpDir = mkDefault true;
@@ -15,9 +15,12 @@ with lib;
   };
   environment.variables = {
     EDITOR = "vim";
+    NIXPKGS_CONFIG = mkForce "";
     PAGER = "less -R";
     SYSTEMD_LESS = "FKMRX";
-    NIXPKGS_CONFIG = mkForce "";
+    # Setting TZ= avoids a lot of useless syscalls reading /etc/localtime
+    # but requires to restart the session to change the time zone for all programs.
+    TZ = config.time.timeZone;
   };
   home-manager.users.root = {
     imports = [