zaneyos/modules/core/xserver.nix
Don Williams 191d97feed Added alejandra formatter to flake.nix
Added alejandra input (for now)
Reformatted all NIX files

 On branch main
 Your branch is up to date with 'origin/main'.

 Changes to be committed:
	modified:   flake.lock
	modified:   flake.nix
	modified:   hosts/default/default.nix
	modified:   hosts/default/hardware.nix
	modified:   hosts/nixstation/default.nix
	modified:   hosts/nixstation/hardware.nix
	modified:   hosts/nixstation/host-packages.nix
	modified:   hosts/zaneyos-24-vm/default.nix
	modified:   hosts/zaneyos-24-vm/hardware.nix
	modified:   hosts/zaneyos-oem/default.nix
	modified:   hosts/zaneyos-oem/hardware.nix
	modified:   modules/core/boot.nix
	modified:   modules/core/cachix.nix
	modified:   modules/core/default.nix
	modified:   modules/core/flatpak.nix
	modified:   modules/core/fonts.nix
	modified:   modules/core/greetd.nix
	modified:   modules/core/hardware.nix
	modified:   modules/core/network.nix
	modified:   modules/core/nfs.nix
	modified:   modules/core/nh.nix
	modified:   modules/core/overlays.nix
	modified:   modules/core/printing.nix
	modified:   modules/core/quickshell.nix
	modified:   modules/core/sddm.nix
	modified:   modules/core/services.nix
	modified:   modules/core/starfish.nix
	modified:   modules/core/steam.nix
	modified:   modules/core/stylix.nix
	modified:   modules/core/syncthing.nix
	modified:   modules/core/thunar.nix
	modified:   modules/core/user.nix
	modified:   modules/core/virtualisation.nix
	modified:   modules/core/xserver.nix
	modified:   modules/drivers/amd-drivers.nix
	modified:   modules/drivers/default.nix
	modified:   modules/drivers/intel-drivers.nix
	modified:   modules/drivers/local-hardware-clock.nix
	modified:   modules/drivers/nvidia-amd-hybrid.nix
	modified:   modules/drivers/nvidia-drivers.nix
	modified:   modules/drivers/nvidia-prime-drivers.nix
	modified:   modules/drivers/vm-guest-services.nix
	modified:   modules/home/bash.nix
	modified:   modules/home/bashrc-personal.nix
	modified:   modules/home/cli/bat.nix
	modified:   modules/home/cli/bottom.nix
	modified:   modules/home/cli/btop.nix
	modified:   modules/home/cli/cava.nix
	modified:   modules/home/cli/fzf.nix
	modified:   modules/home/cli/gh.nix
	modified:   modules/home/cli/git.nix
	modified:   modules/home/cli/htop.nix
	modified:   modules/home/cli/lazygit.nix
	modified:   modules/home/editors/antigravity.nix
	modified:   modules/home/editors/doom-emacs-install.nix
	modified:   modules/home/editors/doom-emacs.nix
	modified:   modules/home/editors/evil-helix.nix
	modified:   modules/home/editors/nvf.nix
	modified:   modules/home/emoji.nix
	modified:   modules/home/gtk.nix
	modified:   modules/home/hyprland/animations-def.nix
	modified:   modules/home/hyprland/animations-dynamic.nix
	modified:   modules/home/hyprland/animations-end4.nix
	modified:   modules/home/hyprland/animations-moving.nix
	modified:   modules/home/hyprland/default.nix
	modified:   modules/home/hyprland/env.nix
	modified:   modules/home/hyprland/hypridle.nix
	modified:   modules/home/hyprland/hyprland.nix
	modified:   modules/home/hyprland/hyprlock.nix
	modified:   modules/home/hyprland/pyprland.nix
	modified:   modules/home/noctalia.nix
	modified:   modules/home/obs-studio.nix
	modified:   modules/home/overview.nix
	modified:   modules/home/qt.nix
	modified:   modules/home/rofi/config-long.nix
	modified:   modules/home/rofi/default.nix
	modified:   modules/home/rofi/rofi.nix
	modified:   modules/home/scripts/default.nix
	modified:   modules/home/scripts/emopicker9000.nix
	modified:   modules/home/scripts/gemini-cli.nix
	modified:   modules/home/scripts/hm-find.nix
	modified:   modules/home/scripts/keybinds.nix
	modified:   modules/home/scripts/note-from-clipboard.nix
	modified:   modules/home/scripts/note.nix
	modified:   modules/home/scripts/nvidia-offload.nix
	modified:   modules/home/scripts/rofi-launcher.nix
	modified:   modules/home/scripts/screenshootin.nix
	modified:   modules/home/scripts/squirtle.nix
	modified:   modules/home/scripts/task-waybar.nix
	modified:   modules/home/scripts/wallsetter.nix
	modified:   modules/home/scripts/web-search.nix
	modified:   modules/home/scripts/zcli.nix
	modified:   modules/home/starship-ddubs-1.nix
	modified:   modules/home/starship.nix
	modified:   modules/home/swappy.nix
	modified:   modules/home/swaync.nix
	modified:   modules/home/tealdeer.nix
	modified:   modules/home/terminals/ghostty.nix
	modified:   modules/home/terminals/kitty.nix
	modified:   modules/home/terminals/wezterm.nix
	modified:   modules/home/virtmanager.nix
	modified:   modules/home/waybar/waybar-curved.nix
	modified:   modules/home/waybar/waybar-ddubs-2.nix
	modified:   modules/home/waybar/waybar-ddubs.nix
	modified:   modules/home/waybar/waybar-dwm-2.nix
	modified:   modules/home/waybar/waybar-jerry.nix
	modified:   modules/home/waybar/waybar-nekodyke.nix
	modified:   modules/home/waybar/waybar-simple.nix
	modified:   modules/home/wlogout/default.nix
	modified:   modules/home/xdg.nix
	modified:   modules/home/yazi/default.nix
	modified:   modules/home/yazi/keymap.nix
	modified:   modules/home/yazi/theme.nix
	modified:   modules/home/yazi/yazi.nix
	modified:   modules/home/zoxide.nix
	modified:   modules/home/zsh/default.nix
	modified:   modules/home/zsh/zshrc-personal.nix
	modified:   profiles/amd-hybrid/default.nix
	modified:   profiles/amd/default.nix
	modified:   profiles/intel/default.nix
	modified:   profiles/nvidia-laptop/default.nix
	modified:   profiles/nvidia/default.nix
	modified:   profiles/vm/default.nix
2025-12-08 00:20:22 -05:00

45 lines
1.3 KiB
Nix

{host, ...}: let
vars = import ../../hosts/${host}/variables.nix;
keyboardLayout = vars.keyboardLayout or "us";
keyboardVariant = vars.keyboardVariant or "";
# Treat only known US-based variants as implying layout = "us".
usVariants = ["dvorak" "colemak" "workman" "intl" "us-intl" "altgr-intl"];
normalizeUSVariant = v:
if v == "us-intl"
then "intl"
else v;
# If layout itself is a US variant (e.g., "dvorak", "us-intl"), normalize it
layoutFromLayout =
if builtins.elem keyboardLayout usVariants
then "us"
else keyboardLayout;
variantFromLayout =
if builtins.elem keyboardLayout usVariants
then normalizeUSVariant keyboardLayout
else "";
# If the provided variant is a US variant, force layout to us; otherwise keep layout
layoutFromVariant =
if builtins.elem keyboardVariant usVariants
then "us"
else layoutFromLayout;
variantFinal =
if builtins.elem keyboardVariant usVariants
then normalizeUSVariant keyboardVariant
else if variantFromLayout != ""
then variantFromLayout
else keyboardVariant;
xkbLayout = layoutFromVariant;
xkbVariant = variantFinal;
in {
services.xserver = {
enable = false;
xkb = {
layout = xkbLayout;
variant = xkbVariant;
};
};
}