Skip to content

modules: scaffold desktop-env (niri + greetd + fonts + DMS bridge) (ADR-028 slice 3b)#44

Merged
dannyfaris merged 1 commit into
mainfrom
desktop-env/02-system-bundle
May 28, 2026
Merged

modules: scaffold desktop-env (niri + greetd + fonts + DMS bridge) (ADR-028 slice 3b)#44
dannyfaris merged 1 commit into
mainfrom
desktop-env/02-system-bundle

Conversation

@dannyfaris

Copy link
Copy Markdown
Owner

Summary

Four standalone modules + a pure-aggregation bundle for hosts running a Wayland desktop session. Per PRD §8.1 #4 (bundle-purity rule): bundles contain only an imports list, no inline option setting. The capabilities of the desktop-env bundle live in standalone siblings.

Standalone modules:

  • niri.nix — imports niri-flake's nixosModule (package + polkit + dconf + OpenGL + xdg.portal + the wayland-sessions/niri.desktop entry that greetd discovers) and enables programs.niri. Opts out of niri-flake's default-true cachix substituter (niri-flake.cache.enable = false) per CLAUDE.md's whitelist > blanket stance — trust delegations should be deliberate. Cost: niri rebuilds from source on every niri-flake bump (~10–30 min on metis-class hardware). The repo may run its own niri cache later rather than re-enabling the upstream one.
  • greetd.nixservices.greetd with tuigreet (--time --remember --remember-session --asterisks) on tty1 (greetd's hardcoded VT — upstream removed the per-host vt option). Break-glass remains kernel TTYs 2–6 via Ctrl-Alt-F2..F6, preserving CLAUDE.md's physical-console posture. useTextGreeter = true so kernel/systemd messages don't paint over tuigreet during cold boot. Uses pkgs.tuigreet directly (the pkgs.greetd.tuigreet alias is deprecated upstream).
  • desktop-fonts.nixstylix.fonts.sansSerif = Inter; stylix.fonts.emoji = Noto Color Emoji. Foundation already sets monospace; these two are desktop-only so headless hosts don't carry the closure.
  • dms-home-bridge.nix — injects DMS's two HM modules (homeModules.dank-material-shell + homeModules.niri) via home-manager.sharedModules. The HM wrapper forwards only hostContext; sharedModules is the existing mechanism for adding HM modules without expanding the args contract.

Bundle: bundles/desktop-env.nix — pure aggregation; imports the four above.

No host imports the bundle yet — slice 3d (#33) does that. Closure unchanged because the bundle is dormant.

Peer review

This PR went through subagent peer-review on the staged diff against twelve correctness/convention checkpoints. The first attempt (configuration-direct monolithic bundle) was caught at peer-review with two blocking findings (services.greetd.vt = 7 removed upstream; pkgs.greetd.tuigreet deprecated) plus the bundle-purity architectural deviation; this refactor addresses all three.

Test plan

  • All five files parse (nix-instantiate --parse).
  • nix build .#nixosConfigurations.metis.config.system.build.toplevel --no-link succeeds.
  • Pre-commit hooks pass (deadnix, statix, shared-purity, hardware-config-banner, actionlint).
  • Peer-reviewed against twelve checkpoints (vt removal, tuigreet rename, useTextGreeter, bundle purity, cachix opt-out path, sharedModules schema, relative paths, no auto-discovery, Stylix font schema, header style, hook compliance, naming clarity).
  • CI matrix green on aarch64-linux + x86_64-linux.

Refs: #33 (ADR-028 slice 3 tracker), ADR-028.

🤖 Generated with Claude Code

@dannyfaris
dannyfaris enabled auto-merge (squash) May 28, 2026 09:44
…DR-028 slice 3b)

Four standalone modules + a pure-aggregation bundle for hosts running a
Wayland desktop session. Pure-aggregation per PRD §8.1 #4 (bundle-purity
rule): bundles contain only an `imports` list, no inline option setting.

Standalone modules added:

- niri.nix — imports niri-flake's nixosModule (package + polkit + dconf
  + OpenGL + xdg.portal + wayland-sessions/niri.desktop entry) and
  enables programs.niri. Opts out of niri-flake's default-true
  cachix substituter (`niri-flake.cache.enable = false`) per CLAUDE.md's
  whitelist > blanket stance — trust delegations should be deliberate.
  Cost: niri rebuilds from source on every niri-flake bump (~10-30 min
  on metis-class hardware). The repo may run its own niri cache later
  rather than re-enabling the upstream one.

- greetd.nix — services.greetd with tuigreet (`--time --remember
  --remember-session --asterisks`) on tty1 (greetd's hardcoded VT —
  upstream removed the per-host vt option with the message "The VT is
  now fixed to VT1"). Break-glass remains kernel TTYs 2-6 via
  Ctrl-Alt-F2..F6, preserving CLAUDE.md's physical-console posture.
  useTextGreeter = true so kernel/systemd messages don't paint over
  the tuigreet UI during cold boot. Uses pkgs.tuigreet directly
  (the pkgs.greetd.tuigreet alias is deprecated upstream).

- desktop-fonts.nix — stylix.fonts.sansSerif = Inter; stylix.fonts.emoji
  = Noto Color Emoji. Foundation already sets monospace (JetBrains Mono
  Nerd Font); these two are desktop-only so headless hosts don't carry
  the ~50 MB font closure.

- dms-home-bridge.nix — home-manager.sharedModules injects DMS's two
  HM modules (homeModules.dank-material-shell + homeModules.niri).
  modules/core/nixos/home-manager.nix forwards only hostContext via
  extraSpecialArgs; sharedModules is the existing NixOS-side mechanism
  for adding HM modules without expanding the args contract.

bundles/desktop-env.nix — pure aggregation; imports the four above.

No host imports the bundle yet (slice 3d will). Verified: every file
parses; `nix build .#nixosConfigurations.metis...` succeeds (closure
unchanged because bundle is dormant); peer-reviewed against twelve
upstream-correctness and convention-compliance points.

Per ADR-028 §Implementation slice 3.
@dannyfaris
dannyfaris force-pushed the desktop-env/02-system-bundle branch from 3cba7fc to 378e152 Compare May 28, 2026 10:15
@dannyfaris
dannyfaris merged commit da9c8e4 into main May 28, 2026
4 checks passed
@dannyfaris
dannyfaris deleted the desktop-env/02-system-bundle branch May 28, 2026 10:19
dannyfaris added a commit that referenced this pull request May 28, 2026
First commit that imports the slice-3 desktop bundles into a real host.
Two-line addition to hosts/metis/default.nix:

- modules/core/nixos/bundles/desktop-env.nix added to `imports`
  (alongside bundles/remote-access.nix).
- home/core/nixos/bundles/desktop-env.nix added to
  hostContext.extraHomeModules (after the shared theming bundle,
  before standalones).

This is the integration test for the four merged slice-3 PRs:
  - #42 (3a) — flake inputs
  - #44 (3b) — system bundle scaffold (niri + greetd + fonts + DMS bridge)
  - #55 (3c) — home bundle scaffold (niri binds + foot + DMS)
  - #57 (3b.5) — niri.cachix.org substituter in nix.settings

…plus the CI-side half currently in flight at #59 (extra_nix_config
in flake-check workflow). This branch is stacked on
desktop-env/ci-niri-cache-trust so the CI workflow trust is in place
when CI evaluates this PR.

Closure delta on metis (expected): niri (from niri.cachix.org), greetd
+ tuigreet, Quickshell + Qt6 + matugen + DMS deps,
xdg-desktop-portal-gnome, polkit-kde-agent-1, gnome-keyring, Inter,
Noto Color Emoji, foot. No regression expected on mercury or
nixos-vm — neither imports the bundles.

Local build verification not possible — dbf is not in nix's
trusted-users, so runtime substituter additions are rejected. The
integration test fires in CI where the GH Actions runner is trusted
and the workflow already declares extra-substituters via #59 (which
this branch inherits). No `nh os switch` here; that's slice 5.

Peer-reviewed (8 checkpoints: bundle placement, no auto-discovery,
closure delta sanity, eval-without-cache, CI matrix arch scoping, CI
ordering / branch base, merge-order safety, edge cases including HM
module order, Stylix font conflicts, pre-commit hooks).

Per ADR-028 §Implementation slice 3.
dannyfaris added a commit that referenced this pull request May 28, 2026
First commit that imports the slice-3 desktop bundles into a real host.
Two-line addition to hosts/metis/default.nix:

- modules/core/nixos/bundles/desktop-env.nix added to `imports`
  (alongside bundles/remote-access.nix).
- home/core/nixos/bundles/desktop-env.nix added to
  hostContext.extraHomeModules (after the shared theming bundle,
  before standalones).

This is the integration test for the four merged slice-3 PRs:
  - #42 (3a) — flake inputs
  - #44 (3b) — system bundle scaffold (niri + greetd + fonts + DMS bridge)
  - #55 (3c) — home bundle scaffold (niri binds + foot + DMS)
  - #57 (3b.5) — niri.cachix.org substituter in nix.settings

…plus the CI-side half currently in flight at #59 (extra_nix_config
in flake-check workflow). This branch is stacked on
desktop-env/ci-niri-cache-trust so the CI workflow trust is in place
when CI evaluates this PR.

Closure delta on metis (expected): niri (from niri.cachix.org), greetd
+ tuigreet, Quickshell + Qt6 + matugen + DMS deps,
xdg-desktop-portal-gnome, polkit-kde-agent-1, gnome-keyring, Inter,
Noto Color Emoji, foot. No regression expected on mercury or
nixos-vm — neither imports the bundles.

Local build verification not possible — dbf is not in nix's
trusted-users, so runtime substituter additions are rejected. The
integration test fires in CI where the GH Actions runner is trusted
and the workflow already declares extra-substituters via #59 (which
this branch inherits). No `nh os switch` here; that's slice 5.

Peer-reviewed (8 checkpoints: bundle placement, no auto-discovery,
closure delta sanity, eval-without-cache, CI matrix arch scoping, CI
ordering / branch base, merge-order safety, edge cases including HM
module order, Stylix font conflicts, pre-commit hooks).

Per ADR-028 §Implementation slice 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant