Files
Nomarchy/core/home/configs.nix
Bernardo Magri 3bcd92df02 feat(keymap): route installer layout choice into Hyprland's Wayland session
core/home/config/nomarchy/default/hypr/input.conf hardcoded
`kb_layout = us`, so the installer's services.xserver.xkb.layout and
console.keyMap writes (both set from the installer's KEYMAP_LAYOUT
prompt) only reached XWayland apps and the TTY console. Native-Wayland
apps — i.e. almost everything in a Nomarchy desktop — fell back to US
regardless of what the user picked. Surprising for any non-US user.

Path (a) from the Later row:

  - Added nomarchy.keymap.{layout,variant} to core/home/options.nix
    (defaults "us" / "").
  - Deleted the static input.conf from the bulk nomarchy/ deploy.
  - Replaced it with an explicit
    xdg.configFile."nomarchy/default/hypr/input.conf".text in
    core/home/configs.nix that interpolates the option values into
    kb_layout / kb_variant.
  - Installer's home.nix heredoc now writes
      nomarchy.keymap = { layout = "$KEYMAP_LAYOUT"; variant = "$KEYMAP_VARIANT"; };
    alongside nomarchy.formFactor, so the layout reaches Hyprland
    consistently with system.nix's xkb.layout / console.keyMap.

Documented in docs/OPTIONS.md (new `nomarchy.keymap.layout` /
`nomarchy.keymap.variant` entry). `nix flake check --no-build` clean.
2026-05-22 18:14:17 +01:00

99 lines
3.1 KiB
Nix

{ config, pkgs, lib, ... }:
let
configDir = ./config;
# Explicit list of config items to manage
# This replaces dynamic builtins.readDir for clarity and faster evaluation
configItems = {
# Directories
fastfetch = "directory";
fcitx5 = "directory";
fontconfig = "directory";
git = "directory";
imv = "directory";
"nautilus-python" = "directory";
nomarchy = "directory";
"nomarchy-skill" = "directory";
uwsm = "directory";
wiremix = "directory";
# Files
"brave-flags.conf" = "regular";
"chromium-flags.conf" = "regular";
"starship.toml" = "regular";
"xdg-terminals.list" = "regular";
};
# Files/directories handled elsewhere or not intended for ~/.config/
# - nomarchy.ttf: font file, not a config
# - waybar: handled in waybar.nix
# - walker: handled in walker.nix
# - alacritty: handled in alacritty.nix
# - swayosd: handled in swayosd.nix
# Check for user overrides
userConfigDir = config.nomarchy.configOverrides;
# Generate the xdg.configFile attribute set
makeMapping = name: type:
let
source = if userConfigDir != null then "${userConfigDir}/${name}" else "${configDir}/${name}";
in {
inherit name;
value = lib.mkDefault {
inherit source;
recursive = type == "directory";
};
};
configMappings = lib.mapAttrs' (name: type: makeMapping name type) configItems;
in
{
xdg.configFile = configMappings // {
# mako reads ~/.config/mako/config by default. The themed Nomarchy
# config (urgency rules, app filters, button handlers) lives under
# nomarchy/default/mako/core.ini for organizational reasons, so wire
# it explicitly here. Without this, mako silently falls back to its
# built-in defaults and every Nomarchy notification customization is
# inert.
"mako/config".source = lib.mkDefault ./config/nomarchy/default/mako/core.ini;
# Hyprland's native-Wayland input config — templated from
# nomarchy.keymap.{layout,variant} so non-US users get the right
# layout in Wayland apps. The previous static input.conf hardcoded
# `kb_layout = us`, so the installer's xkb.layout / console.keyMap
# writes only reached XWayland and the TTY. Generated here rather
# than shipped under config/nomarchy/default/hypr/ so the keymap
# values can vary per-host without a source-file edit.
"nomarchy/default/hypr/input.conf".text = lib.mkDefault ''
# https://wiki.hyprland.org/Configuring/Variables/#input
input {
kb_layout = ${config.nomarchy.keymap.layout}
kb_variant = ${config.nomarchy.keymap.variant}
kb_model =
kb_options = compose:caps
kb_rules =
follow_mouse = 1
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = false
}
}
misc {
key_press_enables_dpms = true # key press will trigger wake
mouse_move_enables_dpms = true # mouse move will trigger wake
}
'';
};
home.file.".XCompose" = lib.mkDefault {
source = ./config/nomarchy/default/xcompose;
};
}