Files
Nomarchy/core/home/options.nix
Bernardo Magri a2649728d3
Some checks failed
Check / eval-and-lint (push) Failing after 6m36s
feat(hyprland): implement declarative monitor scaling and add scale picker to welcome wizard
2026-05-31 19:21:52 +01:00

202 lines
7.3 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.";
};
scale = lib.mkOption {
type = lib.types.str;
default = schema.home.hyprland.scale;
description = ''
Default monitor scale. Use "auto" to let Hyprland decide,
or a numeric string like "1", "1.25", "1.5", "2".
'';
};
};
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 = {
alacritty.enable = lib.mkEnableOption "Alacritty terminal integration";
btop.enable = lib.mkEnableOption "btop resource monitor integration";
ghostty.enable = lib.mkEnableOption "Ghostty terminal integration";
kitty.enable = lib.mkEnableOption "Kitty terminal integration";
lazygit.enable = lib.mkEnableOption "lazygit integration";
tmux.enable = lib.mkEnableOption "tmux integration";
elephant.enable = lib.mkEnableOption "Elephant menu provider integration";
walker.enable = lib.mkEnableOption "Walker launcher integration";
swayosd.enable = lib.mkEnableOption "SwayOSD integration";
vscode = {
enable = lib.mkEnableOption "VSCode integration";
devExtensions = lib.mkEnableOption "Nomarchy's curated VSCode extension pack (language servers + git + editor enhancements)";
};
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.
'';
};
};
}