Load language settings from the config
This commit is contained in:
parent
a9108dd12c
commit
73d72c569e
4 changed files with 22 additions and 7 deletions
scripts/Arch/OS
|
@ -1,14 +1,14 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
. "$dir/../../Common/Scripts/config.fish"
|
||||
|
||||
set -q CONFIG_MODULE || set -l CONFIG_MODULE "$dir/config.nix"
|
||||
set -q ARCH_TIMEZONE || set -l ARCH_TIMEZONE "Europe/Zurich"
|
||||
set -q ARCH_MOUNT_ROOT || set -l ARCH_MOUNT_ROOT ("$dir/../../eval-module.sh" "$CONFIG_MODULE" partition.rootDir --raw)
|
||||
set -q ARCH_MOUNT_ROOT || set -l ARCH_MOUNT_ROOT (getConfig partition.rootDir --raw)
|
||||
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_X11_KEYMAP || set -l ARCH_X11_KEYMAP ch
|
||||
set -q LOCALE_PATTERN || set -l LOCALE_PATTERN "\(de_CH\|en_US\)"
|
||||
|
||||
set -q USER_NAME || set -l USER_NAME manuel
|
||||
set -q USER_DISPLAYNAME
|
||||
|
@ -52,13 +52,17 @@ begin
|
|||
and arch-chroot "$ARCH_MOUNT_ROOT" ln -sf "/usr/share/zoneinfo/$ARCH_TIMEZONE" /etc/localtime
|
||||
and arch-chroot "$ARCH_MOUNT_ROOT" hwclock --systohc
|
||||
|
||||
and arch-chroot "$ARCH_MOUNT_ROOT" sed -i "s/^#\?\($LOCALE_PATTERN.*\)\$/\1/" /etc/locale.gen
|
||||
and arch-chroot "$ARCH_MOUNT_ROOT" locale-gen
|
||||
and begin
|
||||
getConfig i18n.localeSettings --json | \
|
||||
jq --raw-output '[.[] | split(".") | .[0]] | unique | join("\\\\|")'
|
||||
end | begin
|
||||
read LOCALES
|
||||
and arch-chroot "$ARCH_MOUNT_ROOT" sed -i "s/^#\?\(\($LOCALES\).*\)\$/\1/" /etc/locale.gen
|
||||
end
|
||||
|
||||
and begin
|
||||
echo "LANG=de_CH.UTF-8"
|
||||
echo "LANGUAGE=en_US.UTF-8"
|
||||
echo "LC_MESSAGES=en_US.UTF-8"
|
||||
getConfig i18n.localeSettings --json | \
|
||||
jq --raw-output '[keys[] as $key | "\($key)=\(.[$key])"] | join("\n")'
|
||||
end | arch-chroot "$ARCH_MOUNT_ROOT" tee /etc/locale.conf > /dev/null
|
||||
|
||||
and echo "KEYMAP=$ARCH_KEYMAP" | arch-chroot "$ARCH_MOUNT_ROOT" tee /etc/vconsole.conf > /dev/null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue