Files
Nomarchy/core/system/options.nix
Bernardo Magri 8266dc7ee2 feat(system): add accessibility preset module
Opt-in `nomarchy.system.accessibility.enable` (default false —
accessibility is a personal preference, not hardware-derived). Wires
`services.gnome.at-spi2-core`, installs `pkgs.orca`, and sets
`XCURSOR_SIZE` to a configurable `accessibility.cursorSize` (default
32, up from NixOS's 24).

The original roadmap entry bundled Hyprland-side bits (slower
key-repeat, Orca launch keybinding, high-contrast palette). Those
require touching home-manager / theme files and a new palette
directory; split into a separate Next-column row so the system-side
preset ships now and the desktop integration follows independently.
2026-04-26 09:06:02 +01:00

200 lines
6.7 KiB
Nix

{ config, lib, pkgs, ... }:
{
options.nomarchy.system = {
dns = lib.mkOption {
type = lib.types.enum [ "Cloudflare" "Google" "DHCP" "Custom" ];
default = "DHCP";
description = "Selected DNS provider.";
};
customDns = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "List of custom DNS servers.";
};
wifi = {
powersave = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to enable wifi power saving.";
};
};
timezone = lib.mkOption {
type = lib.types.str;
default = "UTC";
description = "System timezone.";
};
formFactor = lib.mkOption {
type = lib.types.enum [ "laptop" "desktop" ];
default = "laptop";
description = ''
Physical form factor. Drives UI affordances (battery widget,
future lid handling / TLP). 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 system.nix.
'';
};
features = {
fingerprint = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable fingerprint support.";
};
fido2 = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable FIDO2 support.";
};
hybridGPU = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable hybrid GPU support (supergfxd).";
};
};
theme = lib.mkOption {
type = lib.types.str;
default = "summer-night";
description = "Selected system theme.";
};
# ----- Tier 1 system features (all opt-in, no behavioural change off) ---
snapper = {
enable = lib.mkEnableOption ''
Snapper-driven BTRFS timeline snapshots of `/`. Auto-disables when
`/` isn't BTRFS. Includes a `nixos-rebuild-snap` wrapper that takes
a "Pre-rebuild" snapshot before each switch.
'';
};
hibernation = {
enable = lib.mkEnableOption ''
suspend-then-hibernate (lid close, idle, power button). NOTE: this
requires a disk swap device or swapfile sized to at least RAM
zRAM alone is not enough.
'';
idleMinutes = lib.mkOption {
type = lib.types.int;
default = 30;
description = "Idle minutes before suspend-then-hibernate fires.";
};
};
laptop = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.nomarchy.system.formFactor == "laptop";
defaultText = lib.literalExpression ''config.nomarchy.system.formFactor == "laptop"'';
description = ''
Laptop power preset: TLP (with sane AC/battery governors),
`services.upower`, `services.thermald` (x86_64), a brightnessctl
udev rule, and a logind lid-switch policy. Force-disables
`services.power-profiles-daemon` (mutually exclusive with TLP).
Lid-close defers to `nomarchy.system.hibernation.enable`:
suspend-then-hibernate when on, suspend otherwise. Defaults on
when `formFactor = "laptop"`.
'';
};
thermald = lib.mkOption {
type = lib.types.bool;
default = pkgs.stdenv.hostPlatform.isx86_64;
defaultText = lib.literalExpression "pkgs.stdenv.hostPlatform.isx86_64";
description = ''
Enable `services.thermald` (Intel thermal daemon). Default true on
x86_64. Harmless no-op on AMD; gated off on aarch64.
'';
};
};
desktop = {
enable = lib.mkOption {
type = lib.types.bool;
default = config.nomarchy.system.formFactor == "desktop";
defaultText = lib.literalExpression ''config.nomarchy.system.formFactor == "desktop"'';
description = ''
Desktop preset: pins `powerManagement.cpuFreqGovernor` to
`"performance"` and enables `services.zfs.autoScrub` and
`services.zfs.trim` so a future ZFS pool gets sensible
maintenance without further config. The ZFS knobs are no-ops
until the user adds `boot.supportedFilesystems = [ "zfs" ]`
and a pool. Defaults on when `formFactor = "desktop"`. Battery
widget filtering is already handled by `formFactor` itself in
`features/desktop/waybar/default.nix`.
'';
};
};
accessibility = {
enable = lib.mkEnableOption ''
Accessibility preset: AT-SPI2 framework, the Orca screen reader
on PATH, and a larger default cursor size. Off by default
accessibility is a personal preference, not a hardware-derived
signal. The Hyprland-side keybinding to launch Orca is a
separate roadmap item.
'';
cursorSize = lib.mkOption {
type = lib.types.int;
default = 32;
description = ''
XCURSOR_SIZE when accessibility is on. NixOS default is 24;
32 is a safer floor for low-vision users. Bump to 48 if the
user explicitly asks.
'';
};
};
containers = {
enable = lib.mkEnableOption ''
Rootless Podman with Docker compatibility (`docker` `podman`),
plus podman-compose, podman-tui and dive.
'';
};
virtualization = {
libvirt = {
enable = lib.mkEnableOption ''
libvirt daemon + virt-manager + OVMF. The user must be in the
`libvirtd` group.
'';
};
docker = {
enable = lib.mkEnableOption ''
Docker daemon + docker-compose. The user must be in the `docker`
group.
'';
};
};
keyring = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Auto-unlock GNOME Keyring at SDDM/Hyprland login and route SSH
keys through `gcr-ssh-agent`. Default on near-universal QoL
improvement.
'';
};
};
inputMethod = {
enable = lib.mkEnableOption ''
fcitx5 input method (CJK / IME). Wires NixOS's i18n.inputMethod and
autostarts fcitx5-daemon. Adds a small footprint when enabled, so
most users want this off.
'';
};
voxtype = {
enable = lib.mkEnableOption ''
voxtype voice-typing integration. NOTE: voxtype is not packaged in
nixpkgs when enabled, install voxtype yourself (e.g. via
`home.packages = [ (pkgs.callPackage {}) ]`). With this off the
SUPER+CTRL+X keybinding and waybar widget are no-ops.
'';
};
};
}