Added keyboard layout support during install

This commit is contained in:
Zsolt Németh 2024-07-24 15:32:51 +02:00
parent a2efb8a089
commit 39ba31d669
4 changed files with 18 additions and 4 deletions

View File

@ -14,6 +14,7 @@ let
browser
terminal
extraMonitorSettings
keyboardLayout
;
in
with lib;
@ -63,7 +64,7 @@ with lib;
col.inactive_border = rgb(${config.stylix.base16Scheme.base01})
}
input {
kb_layout = us
kb_layout = ${keyboardLayout}
kb_options = grp:alt_shift_toggle
kb_options = caps:super
follow_mouse = 1

View File

@ -6,7 +6,9 @@
options,
...
}:
let
inherit (import ../hosts/${host}/variables.nix) keyboardLayout;
in
{
imports = [
./hardware.nix
@ -329,7 +331,7 @@
xserver = {
enable = false;
xkb = {
layout = "us";
layout = "${keyboardLayout}";
variant = "";
};
};
@ -359,7 +361,7 @@
printing = {
enable = true;
drivers = [
# pkgs.hplipWithPlugin
# pkgs.hplipWithPlugin
];
};
gnome.gnome-keyring.enable = true;
@ -467,6 +469,8 @@
driSupport32Bit = true;
};
console.keyMap = "${keyboardLayout}";
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];

View File

@ -12,4 +12,5 @@
# Program Options
browser = "brave"; # Set Default Browser (google-chrome-stable for google-chrome)
terminal = "kitty"; # Set Default System Terminal
keyboardLayout = "us";
}

View File

@ -65,6 +65,14 @@ git config --global user.email "installer@gmail.com"
git add .
sed -i "/^\s*host[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./flake.nix
read -rp "Enter your keyboard layout: [ us ] " keyboardLayout
if [ -z "$keyboardLayout" ]; then
keyboardLayout="us"
fi
sed -i "/^\s*keyboardLayout[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$keyboardLayout\"/" ./hosts/$hostName/variables.nix
echo "-----"
installusername=$(echo $USER)