diff --git a/lib/modules/valhalla.nix b/lib/modules/valhalla.nix index 7740500a..abab8a39 100644 --- a/lib/modules/valhalla.nix +++ b/lib/modules/valhalla.nix @@ -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; + }; }; }; } diff --git a/profiles/Generic/config.nix b/profiles/Generic/config.nix index afe1296d..4f0b5bbd 100644 --- a/profiles/Generic/config.nix +++ b/profiles/Generic/config.nix @@ -35,6 +35,7 @@ }; timeZone = "Europe/Zurich"; + keyMap = "de_CH-latin1"; i18n = { localeSettings = diff --git a/scripts/Arch/OS/setup.fish b/scripts/Arch/OS/setup.fish index 1250cdbd..d3e8e5ce 100644 --- a/scripts/Arch/OS/setup.fish +++ b/scripts/Arch/OS/setup.fish @@ -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,11 @@ begin set -l tempRoot "/opt/$(basename "$projectName")" set -l tempDir "$tempRoot/$relativeDir" - loadkeys "$ARCH_KEYMAP" + if set -l keyMap (getConfig valhalla.keyMap) + loadkeys "$keyMap" + else + true + end and if set -l timezone (getConfig valhalla.timeZone) timedatectl set-timezone "$timezone" @@ -70,7 +73,12 @@ 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 + else + true + end + and echo "$ARCH_HOSTNAME" | arch-chroot "$mountDir" tee /etc/hostname > /dev/null and arch-chroot "$mountDir" mkinitcpio -P