mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-12 07:34:36 +00:00
f5055e2ef6
This makes it clearer that they're part of PAM sessions.
47 lines
834 B
Nix
47 lines
834 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
tzdir = "${pkgs.tzdata}/share/zoneinfo";
|
|
|
|
in
|
|
|
|
{
|
|
options = {
|
|
|
|
time = {
|
|
|
|
timeZone = mkOption {
|
|
default = "CET";
|
|
type = types.str;
|
|
example = "America/New_York";
|
|
description = "The time zone used when displaying times and dates.";
|
|
};
|
|
|
|
hardwareClockInLocalTime = mkOption {
|
|
default = false;
|
|
description = "If set, keep the hardware clock in local time instead of UTC.";
|
|
};
|
|
|
|
};
|
|
};
|
|
|
|
config = {
|
|
|
|
environment.sessionVariables.TZDIR = "/etc/zoneinfo";
|
|
|
|
systemd.globalEnvironment.TZDIR = tzdir;
|
|
|
|
environment.etc.localtime =
|
|
{ source = "${tzdir}/${config.time.timeZone}";
|
|
mode = "direct-symlink";
|
|
};
|
|
|
|
environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo";
|
|
|
|
};
|
|
|
|
}
|