Remove kriswill.* option gating; mount modules into hosts (nebula parity) - #21
Merged
Conversation
The sub-flake keeps its enable/package options (idiomatic API for a module consumed by other repos), but moves out of the kriswill.* namespace ahead of removing that namespace entirely. Lock refreshed for the relative-path input's new narHash.
modules/lib.nix (options.kriswill.lib) is gone; modules/darwin.nix now inlines the nixpkgs.lib.extend call for its specialArgs. lib/default.nix shrinks to the kanagawa palette — mkProgramOption's only consumer was nh.nix, which is now an ungated one-liner (programs.nh.enable toggle removed from core.nix; the nrs/nrt aliases already used lib.getExe).
Drop options.kriswill.<feature>.enable + lib.mkIf from dnsmasq, homebrew, ghostty, macos-defaults, fastfetch, git, kitty, neovim, oksh, zk, diffnav, and dotfiles-stow — every gate evaluated to true on every host (core.nix mkDefault fan-out / per-host dnsmasq), so a mounted module is now simply active. Delete ssh.nix and neovide.nix outright: both were enable-toggle stubs with empty config bodies (their real config lives in the stow tree / host package lists). Matching fan-out lines removed from core.nix, dnsmasq.enable removed from all hosts.
direnv, direnv-nom, tmux, zsh, yazi, htop, and qmd-sqlite lose their mkIf gates; core.nix loses the kriswill.enable master option, the mkDefault fan-out, and its config wrapper — it is now just the plain always-on baseline. direnv-nom's cross-module gate on direnv collapses (both universal) and its never-changed diff enum is hardcoded to nvd. Hosts no longer set kriswill.enable.
flake.modules.darwin.* now holds only modules universal to all three hosts; anything host-selective is a first-class dendritic file under modules/hosts/ merging straight into configurations.darwin.<host>.module (deferredModule definitions merge, same mechanism as nebula's modules/hosts/nebula/*): - claude-account-selector -> modules/hosts/k/ (k-only; its option set is hardcoded in the let block now that it has a single consumer) - alias-en0 -> modules/hosts/SOC-Kris-Williams/ - podman-desktop, apple-container, codebase-memory-mcp -> single modules/hosts/*.nix files mounting a shared module into k + SOC Host files shrink to the blanket import + host package list + platform and overlays. The last kriswill.* option references are gone.
AGENTS.md teaches the new pattern (universal flake.modules.darwin.* vs modules/hosts/ mounts, no enable options). knowledge/: the module option pattern doc becomes patterns/host-mounted-modules.md, the add-module playbook gains the where-does-it-mount decision, a decision record (decisions/remove-option-gating.md) captures the rationale and parity evidence, and okf scaffold now classifies modules/hosts/ files as host definitions vs host-mounted feature mounts (stubbing the latter into knowledge/modules/ with mount-site links). Catalog docs refreshed; ssh/neovide/lib docs retired with their modules. okf validate: 0 errors, 0 warnings.
Design revision: host-selective features return to modules/darwin/ behind idiomatic enable options instead of naked mount files under modules/hosts/ — - podman-desktop: programs.podman-desktop.enable - claude-account-selector: full programs.claude-account-selector.* option set restored (defaultProfile/profiles/rules/desktopProfile); host k sets its values again - apple-container + codebase-memory-mcp: back to plain re-exports of the sub-flake darwin modules; hosts opt in via services.<name>.enable modules/hosts/ now holds only host folders named by exact hostname (k/, mini/, SOC-Kris-Williams/ — each a default.nix, darwin or later nixos), with truly host-specific files beside default.nix (SOC-Kris-Williams/alias-en0.nix).
AGENTS.md and the knowledge bundle now describe the three tiers: universal (ungated flake.modules.darwin.*), host-selective (behind programs./services. enables flipped in modules/hosts/<hostname>/ default.nix), and host-specific files beside a host's default.nix. okf scaffold classifies host folders (flat <host>.nix still recognized for nebula compat), stubs host-specific sibling files as darwin-module docs, and notes the enable option in gated modules' stubs. Decision record and log updated; okf validate 0/0.
The nrs/nrt environment.shellAliases only existed in interactive zsh, so non-interactive shells (agent harnesses, scripts) couldn't use them — and nrt was silently broken anyway: both 'nh darwin test' and 'darwin-rebuild test' have been removed upstream. The nh module now ships writeShellScriptBin helpers instead: nrs — nh darwin switch (sudo at activation) nrb — nh darwin build (no root; safe for agents) [new] nrt — darwin-rebuild check (build + system.checks, no activation) Extra args pass through (nrs -v, nrb --dry). Verified: helpers land in sw/bin and nrb runs from a non-interactive shell; closure diff vs the running system is just the three scripts (~2 KiB).
- direnv-nom: restore the accidentally-removed closure-diff selector as
programs.direnv-nom.diff (nvd/native/none, default nvd) — a behavior
setting on a universal module, not a gate; the optionalString guards
are live again
- universal modules: re-add lib.mkDefault to override-prone scalars
(dnsmasq enable/bind/addresses-as-a-whole (types.attrs — no per-key
merging), homebrew enable/onActivation, macos-defaults, neovim env
vars, oksh ENV, zsh history/highlighting). EDITOR uses mkOverride 900:
nix-darwin's own 'EDITOR = mkDefault nano' would tie with a second
mkDefault. mkForce escape hatch documented in the pattern doc and
decision record
- nh: nrs/nrb share an mkNhHelper instead of copy-pasted script bodies
- okf scaffold: sub-flake re-exports are no longer stamped 'mounted
ungated' (enable option detected from the backticked comment hint,
generic gated fallback otherwise); attrset-form
'programs.<x> = { enable = true; }' host enables are detected;
same-basename host-specific files get host-qualified doc names
instead of silently colliding; module descriptions prefer the leading
comment over arbitrary option description strings
Verified: flake check green on all hosts; nix store diff-closures vs
the running system is empty (only darwin-version dirtyRev churn);
scaffold fixes exercised in a scratch repo copy incl. a synthetic
mini/alias-en0.nix collision; okf validate 0/0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
options.kriswill.<feature>.enable+lib.mkIfgating pattern and itscore.nixmkDefault truefan-out. Feature selection is now expressed at the host, and the file arrangement deliberately mirrors thenebula-snowglobeNixOS branch so the two can merge cleanly later.Three tiers (documented in
knowledge/patterns/host-mounted-modules.md):flake.modules.darwin.<name>; hosts blanket-import the set. Override-prone scalars carrylib.mkDefaultso a host can override with a plain assignment (lib.mkForcefor the rest).programs.<name>.*for user-facing programs (podman-desktop, claude-account-selector with its full option set),services.<name>.*for sub-flake re-exports (apple-container, codebase-memory-mcp) — flipped in the wanting host'sdefault.nix.default.nix(e.g.modules/hosts/SOC-Kris-Williams/alias-en0.nix).Hosts are folders now:
modules/hosts/<hostname>/default.nix(exact hostname; darwin today, nixos after the nebula merge).Also in here
kriswill.apple-container.*→services.apple-container.*modules/lib.nix(kriswill.lib) andmkProgramOptionremoved; the darwin realiser extendsnixpkgs.libinline (kanagawa kept)ssh.nix/neovide.nixdeleted — both were enable-toggle stubs with empty config bodiesnrs/nrtshell aliases became real executables (+ newnrbfor root-less builds); the oldnrtwas silently broken — bothnh darwin testanddarwin-rebuild testno longer exist upstream, sonrtnow runsdarwin-rebuild checkokf scaffoldunderstands the host-folder layout (host vs host-specific-file classification, attrset-form enable detection, basename-collision-safe doc names, re-export gating via comment hint)knowledge/decisions/remove-option-gating.md, log entries;okf validate0/0programs.direnv-nom.diffselector)Verification
nix flake checkgreen (builds all three host toplevels)nix store diff-closuresbetween pre-refactor baseline builds and the result is empty for all three hosts; the only eval-snapshot delta anywhere is the intentionalservices.apple-containerstring inside one error messagecontainerCLI + codebase-memory-mcp daemon verified