Files
Nomarchy/core/home/options.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

169 lines
5.5 KiB
Nix

{ lib, pkgs, ... }:
let
# Defaults live in lib/state-schema.nix so they can't drift between this
# file, core/system/options.nix, and core/home/state.nix's `or` fallbacks.
schema = import ../../lib/state-schema.nix { inherit lib; };
in
{
options.nomarchy = {
toggles = {
suspend = lib.mkOption {
type = lib.types.bool;
default = schema.home.suspend;
description = "Whether to show suspend in system menu.";
};
screensaver = lib.mkOption {
type = lib.types.bool;
default = schema.home.screensaver;
description = "Whether the screensaver is enabled.";
};
idle = lib.mkOption {
type = lib.types.bool;
default = schema.home.idle;
description = "Whether the idle lock is enabled.";
};
nightlight = lib.mkOption {
type = lib.types.bool;
default = schema.home.nightlight;
description = "Whether the nightlight is enabled.";
};
waybar = lib.mkOption {
type = lib.types.bool;
default = schema.home.waybar;
description = "Whether the top bar is enabled.";
};
};
nightlightTemperature = lib.mkOption {
type = lib.types.int;
default = schema.home.nightlightTemperature;
description = "Temperature for the nightlight.";
};
theme = lib.mkOption {
type = lib.types.str;
default = schema.home.theme;
description = "System theme name.";
};
formFactor = lib.mkOption {
type = lib.types.enum [ "laptop" "desktop" ];
default = "laptop";
description = ''
Physical form factor. Drives UI affordances (battery widget,
future lid handling). Default "laptop" battery widget is
harmless on a desktop (renders empty when no BAT* is present),
so the safe default is "show, don't hide". The installer
auto-detects via /sys/class/power_supply/BAT* and writes the
explicit value into the generated home.nix.
'';
};
keymap = {
layout = lib.mkOption {
type = lib.types.str;
default = "us";
example = "dk";
description = ''
Keyboard layout for Hyprland's native Wayland session. The
installer also writes services.xserver.xkb.layout (for XWayland)
and console.keyMap (for the TTY) to the same value via
system.nix, but Hyprland reads its own input config so it needs
this option independently otherwise non-US users get the
right layout in XWayland apps and the console but the US
fallback inside native-Wayland apps.
'';
};
variant = lib.mkOption {
type = lib.types.str;
default = "";
example = "intl";
description = ''
Keyboard variant for Hyprland (e.g. "intl" for US-International).
Empty by default.
'';
};
};
wallpaper = lib.mkOption {
type = lib.types.str;
default = schema.home.wallpaper;
description = "System wallpaper path.";
};
panelPosition = lib.mkOption {
type = lib.types.enum [ "top" "bottom" ];
default = schema.home.panelPosition;
description = "Waybar panel position.";
};
hyprland = {
gaps_in = lib.mkOption {
type = lib.types.int;
default = schema.home.hyprland.gaps_in;
description = "Inner gaps for Hyprland.";
};
gaps_out = lib.mkOption {
type = lib.types.int;
default = schema.home.hyprland.gaps_out;
description = "Outer gaps for Hyprland.";
};
border_size = lib.mkOption {
type = lib.types.int;
default = schema.home.hyprland.border_size;
description = "Border size for Hyprland.";
};
};
fonts = {
monospace = lib.mkOption {
type = lib.types.str;
default = schema.home.font;
description = "System monospace font.";
};
};
iconsTheme = lib.mkOption {
type = lib.types.str;
default = "Yaru-blue";
description = "System icon theme name.";
};
isLightMode = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether the current theme is light mode.";
};
cursor = {
name = lib.mkOption {
type = lib.types.str;
default = "Bibata-Modern-Ice";
description = "Mouse cursor theme name.";
};
package = lib.mkOption {
type = lib.types.package;
default = pkgs.bibata-cursors;
description = "Package providing the cursor theme.";
};
};
configOverrides = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Path to a directory containing configuration overrides.";
};
apps = {
opencode = {
enable = lib.mkEnableOption ''
opencode AI coding CLI integration. When on, deploys
~/.config/opencode/opencode.json. The `opencode` package itself
is not installed by Nomarchy add it to your home.nix if you
want it on PATH.
'';
};
};
gaming = {
enable = lib.mkEnableOption ''
Gaming preset (home-side companion to nomarchy.system.gaming.enable).
Adds a Hyprland window rule that fullscreens windows whose class
matches steam_app_* i.e. games launched through Steam so they
grab the whole screen instead of opening windowed. Set this to the
same value as nomarchy.system.gaming.enable; the installer flips
both when the Gaming profile is selected.
'';
};
};
}