Allow setting the key map

This commit is contained in:
Manuel Thalmann 2024-07-11 22:05:36 +02:00
parent 8692c51a7f
commit 9962e8e147
3 changed files with 14 additions and 3 deletions

View file

@ -17,6 +17,12 @@
description = "The time zone of the system.";
default = null;
};
keyMap = mkOption {
type = types.nullOr types.str;
description = "The console key map of the system.";
default = null;
};
};
};
}

View file

@ -35,6 +35,7 @@
};
timeZone = "Europe/Zurich";
keyMap = "de_CH-latin1";
i18n = {
localeSettings =

View file

@ -5,7 +5,6 @@ begin
source "$dir/../../Common/Scripts/hooks.fish"
set -q CONFIG_MODULE || set -l CONFIG_MODULE "$dir/config.nix"
set -q ARCH_KEYMAP || set -l ARCH_KEYMAP de_CH-latin1
set -q ARCH_X11_KEYMAP || set -l ARCH_X11_KEYMAP ch
set -l mountDir (getConfig valhalla.partition.rootDir)
@ -20,7 +19,9 @@ begin
set -l tempRoot "/opt/$(basename "$projectName")"
set -l tempDir "$tempRoot/$relativeDir"
loadkeys "$ARCH_KEYMAP"
if set -l keyMap (getConfig valhalla.keyMap)
loadkeys "$keyMap"
end
and if set -l timezone (getConfig valhalla.timeZone)
timedatectl set-timezone "$timezone"
@ -66,7 +67,10 @@ begin
jq --raw-output '[keys[] as $key | "\($key)=\(.[$key])"] | join("\n")'
end | arch-chroot "$mountDir" tee /etc/locale.conf > /dev/null
and echo "KEYMAP=$ARCH_KEYMAP" | arch-chroot "$mountDir" tee /etc/vconsole.conf > /dev/null
and if set -q keyMap
echo "KEYMAP=$keyMap" | arch-chroot "$mountDir" tee /etc/vconsole.conf > /dev/null
end
and echo "$ARCH_HOSTNAME" | arch-chroot "$mountDir" tee /etc/hostname > /dev/null
and arch-chroot "$mountDir" mkinitcpio -P