diff --git a/core/system/default.nix b/core/system/default.nix index 25f0427..2d428fd 100644 --- a/core/system/default.nix +++ b/core/system/default.nix @@ -20,6 +20,7 @@ # Tier 1 system features (all opt-in via nomarchy.system.*). ./snapper.nix ./laptop.nix + ./desktop.nix ./hibernate.nix ./containers.nix ./pam.nix diff --git a/core/system/desktop.nix b/core/system/desktop.nix new file mode 100644 index 0000000..e627452 --- /dev/null +++ b/core/system/desktop.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: + +let + cfg = config.nomarchy.system.desktop; +in +{ + config = lib.mkIf cfg.enable { + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; + + # No-op until the user adds ZFS to boot.supportedFilesystems and a pool; + # then maintenance kicks in without further config. + services.zfs.autoScrub.enable = lib.mkDefault true; + services.zfs.trim.enable = lib.mkDefault true; + }; +} diff --git a/core/system/options.nix b/core/system/options.nix index a6f93fa..c5f59c9 100644 --- a/core/system/options.nix +++ b/core/system/options.nix @@ -108,6 +108,24 @@ }; }; + 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`. + ''; + }; + }; + containers = { enable = lib.mkEnableOption '' Rootless Podman with Docker compatibility (`docker` → `podman`), diff --git a/docs/OPTIONS.md b/docs/OPTIONS.md index 93b933a..27919e7 100644 --- a/docs/OPTIONS.md +++ b/docs/OPTIONS.md @@ -75,6 +75,10 @@ Wired in `features/desktop/waybar/default.nix` (filters the battery widget out o `bool`, default `true` on x86_64. Enables `services.thermald` (Intel thermal daemon). Harmless no-op on AMD; gated off on aarch64. +### `nomarchy.system.desktop.enable` + +`bool`, default `nomarchy.system.formFactor == "desktop"`. Desktop preset: pins `powerManagement.cpuFreqGovernor` to `"performance"` (via `mkDefault`) and enables `services.zfs.autoScrub` + `services.zfs.trim` so a future ZFS pool gets sensible maintenance without further config. The ZFS knobs are no-ops until you add `boot.supportedFilesystems = [ "zfs" ]` (plus `networking.hostId`) and a pool. Battery-widget filtering is handled by `formFactor` itself, so this preset doesn't repeat it. + ### `nomarchy.system.containers.enable` `bool`, default `false`. Rootless Podman with Docker compatibility (`docker` → `podman`), plus `podman-compose`, `podman-tui`, and `dive`. diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index b7769f3..1fc24f9 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -23,7 +23,6 @@ Guardrails (apply when adding anything): ### Next (bigger lifts that build on Now) -- **Desktop preset module.** CPU governor `performance` by default, no battery widget (already done), ZFS-friendly defaults for users who later add a pool. - **Accessibility preset.** Larger cursor, slower key-repeat defaults, `services.orca`, screen reader keybinding, high-contrast theme variant. - **Gaming preset.** `programs.steam.enable`, `programs.gamemode.enable`, `services.flatpak.enable` with a curated remote, and a Hyprland window-rule to fullscreen Steam-launched apps. - **First-run welcome wizard.** Extend `nomarchy-welcome` from a one-shot greeter into a guided picker: theme, panel position, monospace font, "what's a sane home.nix to start with?". Runs once, persists "done" in `state.json`. @@ -125,6 +124,7 @@ Each PR description should reference the row(s) in `docs/SCRIPTS.md` it closes, (Move items here when they land — keep them brief, link the commit/PR.) +- _2026-04-26_ — Desktop preset module (`core/system/desktop.nix`). New `nomarchy.system.desktop.enable` option; defaults to `formFactor == "desktop"` (mirror of the laptop preset's auto-enable). Pins `powerManagement.cpuFreqGovernor` to `"performance"` and enables `services.zfs.{autoScrub,trim}` so a future ZFS pool gets sensible maintenance for free. - _2026-04-26_ — Laptop preset module (`core/system/laptop.nix`). New `nomarchy.system.laptop.{enable,thermald}` options; `enable` defaults to `formFactor == "laptop"` so the installer's existing `formFactor` write auto-flips it on. Wires TLP (governors + 75/80 charge thresholds), force-disables `power-profiles-daemon`, enables `upower` and `thermald` (x86_64), adds the brightnessctl udev rule for backlight without root, and sets a logind lid-switch policy that defers to `hibernation.enable`. Closes both the Now item and the largest Next item. - _2026-04-25_ — Software-profile multi-select in the installer. Users can now pick Dev, Gaming, Office, Media, and CLI Utils profiles during install; logic emits corresponding `home.packages` and system toggles into the generated config. - _2026-04-25_ — Pillar 3 Phase B: script & menu audit. Ported/implemented/stubbed ~40 scripts including `nomarchy-version`, `nomarchy-debug`, `nomarchy-reinstall`, `nomarchy-rollback`, `nomarchy-update-firmware`, `nomarchy-pkg-*`, and `nomarchy-theme-*` wrappers. Moved desktop scripts to packaged utility directory.