Skip to content

refactor(modules): replace mkModuleV2 with per-user mkFeature compiler - #37

Merged
GDR merged 67 commits into
masterfrom
refactor/feature-compiler-hm-parity
Oct 26, 2026
Merged

GDR merged 67 commits into
masterfrom
refactor/feature-compiler-hm-parity

Conversation

@GDR

@GDR GDR commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add lib/features.nix with mkFeature descriptor constructor, tri-state hierarchical category cascade resolution (nullOr bool), per-user transitive requires resolution, and native Home Manager submodule import compiler
  • Replace untyped types.attrs on hostUsers.<user>.modules with strongly-typed hierarchical options generated from the merged feature catalog
  • Add extensions/empty default private-extension flake input stub implementing the dotExtension contract
  • Migrate all 50 home feature modules in modules/home/** from mkModuleV2 to mkFeature in dedicated atomic commits
  • Move git configuration to modules/home/shell/git.nix and isolate user GUI tools (pavucontrol, pulseaudio, tailscale-systray) to per-user home features
  • Remove legacy mkModuleV2 and mkModule helpers
  • Add multi-user isolation and per-user option checks in checks.nix

GDR added 30 commits October 26, 2026 16:49
- Add extensions/empty/flake.nix implementing the dotExtension contract
- Register private-extension input in flake.nix
- Add lib/features.nix with mkFeature descriptor constructor and feature compiler
- Implement per-user tri-state enablement resolution with category cascade and child opt-out
- Resolve transitive feature dependencies per user via moduleRegistry.resolveDeps
- Generate strongly-typed option trees for options.modules.home.* and hostUsers.<user>.modules.home.*
- Provide freeformType on hostUsers.<user>.modules for seamless mkModuleV2 coexistence
- Compile dynamic per-user Home Manager module imports with merged featureCfg and userName
- Implement per-user dotfiles compilation with live/store modes
- Wire two-stage system activation (nixosModule / darwinModule) passing selectedUsers
- Wire inputs.private-extension.dotExtension with disjoint path validation
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Split homebrew cask to darwinModule and user config to homeModule
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Migrate audio to mkFeature\n- Drop home-manager.users broadcast from sound.nix
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Fix osConfig.programs.hyprland.enable check\n- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Extract tailscale-systray feature\n- Remove home-manager broadcast from tailscale.nix
- Convert to mkFeature descriptor
- Read featureCfg.rules and featureCfg.mcpServers inside homeModule
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
GDR added 14 commits October 26, 2026 16:50
- Split homebrew cask to darwinModule and dotfiles to homeModule
- Split homebrew cask to darwinModule
- Convert to mkFeature descriptor
- Convert to mkFeature descriptor
- Move Darwin tools to user packages\n- Manage Linux docker group in nixosModule
- Manage vboxusers group in nixosModule and cask in darwinModule
- Detect host platform from osConfig.nixpkgs.system\n- Use { ... }@hmArgs in user.nix home-manager.users
- Handle null or missing pkgs at registry import time
- Fix argument passing to isFeatureEnabledForUser
…tigravity

- Merge duplicate modules.system.all blocks in nix-goldstar default.nix
- Remove redundant top-level modules.home.editors.antigravity in mac-brightstar default.nix
- Remove legacy mkModuleV2, mkModule, and mkModuleConfig helpers from lib/default.nix
- Update wrapModuleFile in lib/flakeHelpers.nix now that all home modules are features
- Add mcp-config-generation check verifying per-user MCP config on nix-goldstar
- Add multi-user-isolation check verifying isolation between dgarifullin and bob
- Add cascade-child-opt-out check verifying category cascade with child opt-out
- Update AGENTS.md module types table, feature structure, and helpers for mkFeature
- Update nix-module-creation SKILL.md templates and parameters for mkFeature
- Format checks.nix, lib/default.nix, lib/features.nix, and lib/flakeHelpers.nix
@GDR
GDR force-pushed the refactor/feature-compiler-hm-parity branch from a4dd76c to f3433e5 Compare October 26, 2026 13:55
Comment thread lib/features.nix Outdated
}:
let
sys = osConfig.nixpkgs.system or "";
isDarwinHost = lib.hasSuffix "-darwin" sys || (osConfig ? system && osConfig.system ? primaryUser);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we can use:
pkgs.stdenv.hostPlatform.isDarwin

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — updated compileUserHomeModules and resolveUserFeatures to accept pkgs from user.nix and use pkgs.stdenv.hostPlatform.isDarwin directly.

nixosSystems.home.packages = with pkgs; [

darwinModule = {
homebrew.casks = [ "virtualbox" ];

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there home packages for virtualbox?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for Darwin — pkgs.virtualbox in nixpkgs is x86_64-linux-only (meta.platforms = [ "x86_64-linux" ]) because macOS requires Oracle's signed DriverKit/kext installer .pkg, and Home Manager doesn't have a virtualbox module. On Linux it uses virtualisation.virtualbox.host.enable = true + pkgs.virtualbox. Added a comment clarifying why Darwin uses the Homebrew cask.

homebrew.casks = [ "macfuse" ];
};
darwinModule = {
homebrew.casks = [ "macfuse" ];

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there macfuse in home modules?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No — neither Home Manager nor nix-darwin has a macfuse module, and nixpkgs only packages pkgs.macfuse-stubs (build-time headers/stubs that still require the closed-source /Library/Filesystems/macfuse.fs kernel extension from the official installer / Homebrew cask). Added an explanatory comment.

- Restore documentation comments and shared extensions block in vivaldi.nix
- Resolve deadnix unused binding in lib/default.nix
- Resolve statix empty-pattern and eta-reduction warnings
nixosSystems.home.packages = [ pkgs.ghostty ];
darwinSystems.homebrew.casks = [ "ghostty" ];
darwinModule = {
homebrew.casks = [ "ghostty" ];

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be ghostty in nix home modules

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Switched to Home Manager's programs.ghostty.enable = true with pkgs.ghostty-bin on Darwin (pre-built signed universal .app bundle in cache.nixos.org) and pkgs.ghostty on Linux, dropping the Homebrew cask.

Comment thread modules/home/security/bitwarden.nix Outdated
home.packages = [ pkgs.bitwarden-desktop ];
};
darwinModule = {
homebrew.casks = [ "bitwarden" ];

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check bitwarden in home nix modules

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkgs.bitwarden-desktop in nixpkgs now supports aarch64-darwin and is pre-built in cache.nixos.org. Switched to homeModule with home.packages = [ pkgs.bitwarden-desktop ]; across both Linux and Darwin, dropping the Homebrew cask.

Comment thread modules/home/desktop/gnome/gnome.nix Outdated

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove gnome entierly

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed modules/home/desktop/gnome/gnome.nix and cleaned up its reference in hosts/machines/nix-goldstar/default.nix and profiles/desktop.nix.

@GDR
GDR merged commit bc62f70 into master Oct 26, 2026
3 checks passed
@GDR
GDR deleted the refactor/feature-compiler-hm-parity branch October 26, 2026 14:16
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