diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-01-13 13:16:17 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-01-13 13:16:17 +0100 |
commit | 6fb27abf3330139b7f5a868ae988fcf04284a1ca (patch) | |
tree | 4e5772e2bf7b785413ea69d15deb38e53925cf6e /nixos/modules | |
parent | 78d3180dbe8896500a35a848675462aeafe6f1b9 (diff) | |
parent | cf4acab5670e9c04cbd924ad0835ba5a5219b296 (diff) |
Merge branch 'java'
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/config/timezone.nix | 6 | ||||
-rw-r--r-- | nixos/modules/system/etc/setup-etc.pl | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/nixos/modules/config/timezone.nix b/nixos/modules/config/timezone.nix index 07a76d9ad1fa9..42fbe841d0703 100644 --- a/nixos/modules/config/timezone.nix +++ b/nixos/modules/config/timezone.nix @@ -25,9 +25,11 @@ with pkgs.lib; config = { 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"; diff --git a/nixos/modules/system/etc/setup-etc.pl b/nixos/modules/system/etc/setup-etc.pl index 7cb6d2a6a45ed..4b79dbaab89e8 100644 --- a/nixos/modules/system/etc/setup-etc.pl +++ b/nixos/modules/system/etc/setup-etc.pl @@ -57,9 +57,13 @@ sub link { open MODE, "<$_.mode"; my $mode = <MODE>; chomp $mode; close MODE; - copy "$static/$fn", "$target.tmp" or warn; - chmod oct($mode), "$target.tmp" or warn; - rename "$target.tmp", $target or warn; + if ($mode eq "direct-symlink") { + atomicSymlink readlink("$static/$fn"), $target or warn; + } else { + copy "$static/$fn", "$target.tmp" or warn; + chmod oct($mode), "$target.tmp" or warn; + rename "$target.tmp", $target or warn; + } } elsif (-l "$_") { atomicSymlink "$static/$fn", $target or warn; } |