Allow specifying the timezone
This commit is contained in:
parent
11bfd4fa17
commit
224db1d635
|
@ -1,6 +1,22 @@
|
||||||
{ ... }: {
|
{ lib, ... }:
|
||||||
imports = [
|
let
|
||||||
./i18n.nix
|
inherit (lib)
|
||||||
./partition.nix
|
mkOption
|
||||||
];
|
types
|
||||||
}
|
;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
./i18n.nix
|
||||||
|
./partition.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
valhalla = {
|
||||||
|
timeZone = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "The time zone of the system.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
timeZone = "Europe/Zurich";
|
||||||
|
|
||||||
i18n = {
|
i18n = {
|
||||||
localeSettings =
|
localeSettings =
|
||||||
let defaultLocale = "en_US.UTF-8";
|
let defaultLocale = "en_US.UTF-8";
|
||||||
|
|
|
@ -5,7 +5,6 @@ begin
|
||||||
source "$dir/../../Common/Scripts/hooks.fish"
|
source "$dir/../../Common/Scripts/hooks.fish"
|
||||||
|
|
||||||
set -q CONFIG_MODULE || set -l CONFIG_MODULE "$dir/config.nix"
|
set -q CONFIG_MODULE || set -l CONFIG_MODULE "$dir/config.nix"
|
||||||
set -q ARCH_TIMEZONE || set -l ARCH_TIMEZONE "Europe/Zurich"
|
|
||||||
set -q ARCH_LANG || set -l ARCH_LANG en_US.UTF-8
|
set -q ARCH_LANG || set -l ARCH_LANG en_US.UTF-8
|
||||||
set -q ARCH_KEYMAP || set -l ARCH_KEYMAP de_CH-latin1
|
set -q ARCH_KEYMAP || set -l ARCH_KEYMAP de_CH-latin1
|
||||||
set -q ARCH_X11_KEYMAP || set -l ARCH_X11_KEYMAP ch
|
set -q ARCH_X11_KEYMAP || set -l ARCH_X11_KEYMAP ch
|
||||||
|
@ -23,7 +22,10 @@ begin
|
||||||
set -l tempDir "$tempRoot/$relativeDir"
|
set -l tempDir "$tempRoot/$relativeDir"
|
||||||
|
|
||||||
loadkeys "$ARCH_KEYMAP"
|
loadkeys "$ARCH_KEYMAP"
|
||||||
and timedatectl set-timezone "$ARCH_TIMEZONE"
|
|
||||||
|
and if set -l timezone (getConfig valhalla.timeZone)
|
||||||
|
timedatectl set-timezone "$timezone"
|
||||||
|
end
|
||||||
|
|
||||||
and CONFIG_MODULE=$CONFIG_MODULE bash "$dir/../../Common/OS/partition.sh"
|
and CONFIG_MODULE=$CONFIG_MODULE bash "$dir/../../Common/OS/partition.sh"
|
||||||
|
|
||||||
|
@ -46,7 +48,10 @@ begin
|
||||||
|
|
||||||
and arch-chroot "$mountDir" systemctl enable NetworkManager
|
and arch-chroot "$mountDir" systemctl enable NetworkManager
|
||||||
|
|
||||||
and arch-chroot "$mountDir" ln -sf "/usr/share/zoneinfo/$ARCH_TIMEZONE" /etc/localtime
|
and if set -q timezone
|
||||||
|
arch-chroot "$mountDir" ln -sf "/usr/share/zoneinfo/$timezone" /etc/localtime
|
||||||
|
end
|
||||||
|
|
||||||
and arch-chroot "$mountDir" hwclock --systohc
|
and arch-chroot "$mountDir" hwclock --systohc
|
||||||
|
|
||||||
and begin
|
and begin
|
||||||
|
|
Loading…
Reference in a new issue