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

View File

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

View File

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

View File

@ -65,6 +65,14 @@ git config --global user.email "installer@gmail.com"
git add . git add .
sed -i "/^\s*host[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$hostName\"/" ./flake.nix 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 "-----" echo "-----"
installusername=$(echo $USER) installusername=$(echo $USER)