Files
Nomarchy/core/home/options.nix
Bernardo Magri ce7010bb67 feat(accessibility): home-side Hyprland companion
New nomarchy.accessibility.enable home option mirroring
nomarchy.system.accessibility.enable. When enabled, core/home/
accessibility.nix contributes a Hyprland extraConfig block via
lib.mkAfter:

  - input.repeat_rate = 25 (from 40)
  - input.repeat_delay = 1000 ms (from 600)
    Holding a key isn't a runaway machine-gun for low-mobility users.

  - bindd = SUPER ALT, S, Launch Orca, exec, orca
    The system preset already puts orca on PATH.

mkAfter guarantees the slowdown wins over the templated input.conf.
Documented in docs/OPTIONS.md. The third item from the original Next
row — a high-contrast palette — is split into its own Later row
because it's a design task (24-colour WCAG AAA palette + icon family
choice) that wants its own review.

`nix flake check --no-build` clean.
2026-05-22 18:42:13 +01:00

183 lines
6.2 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.
'';
};
accessibility = {
enable = lib.mkEnableOption ''
Accessibility preset (home-side companion to
nomarchy.system.accessibility.enable). Adjusts the Hyprland
Wayland session in three ways: slows input.repeat_rate to 25
(from 40) and input.repeat_delay to 1000 ms (from 600) so
holding a key isn't a runaway machine-gun for users with
low-mobility hands; binds SUPER+ALT+S to launch the Orca screen
reader (the system preset already puts orca on PATH); and is
the gate behind which a future high-contrast palette will hide.
Set this to the same value as nomarchy.system.accessibility.enable.
'';
};
};
}