Repository navigation
refactor(modules): replace mkModuleV2 with per-user mkFeature compiler - #37
Conversation
- 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
… in features compiler
- 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
- 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
a4dd76c to
f3433e5
Compare
| }: | ||
| let | ||
| sys = osConfig.nixpkgs.system or ""; | ||
| isDarwinHost = lib.hasSuffix "-darwin" sys || (osConfig ? system && osConfig.system ? primaryUser); |
There was a problem hiding this comment.
Seems like we can use:
pkgs.stdenv.hostPlatform.isDarwin
There was a problem hiding this comment.
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" ]; |
There was a problem hiding this comment.
Is there home packages for virtualbox?
There was a problem hiding this comment.
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" ]; |
There was a problem hiding this comment.
Is there macfuse in home modules?
There was a problem hiding this comment.
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" ]; |
There was a problem hiding this comment.
I think there should be ghostty in nix home modules
There was a problem hiding this comment.
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.
| home.packages = [ pkgs.bitwarden-desktop ]; | ||
| }; | ||
| darwinModule = { | ||
| homebrew.casks = [ "bitwarden" ]; |
There was a problem hiding this comment.
Check bitwarden in home nix modules
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Removed modules/home/desktop/gnome/gnome.nix and cleaned up its reference in hosts/machines/nix-goldstar/default.nix and profiles/desktop.nix.
Summary
lib/features.nixwithmkFeaturedescriptor constructor, tri-state hierarchical category cascade resolution (nullOr bool), per-user transitiverequiresresolution, and native Home Manager submodule import compilertypes.attrsonhostUsers.<user>.moduleswith strongly-typed hierarchical options generated from the merged feature catalogextensions/emptydefaultprivate-extensionflake input stub implementing thedotExtensioncontractmodules/home/**frommkModuleV2tomkFeaturein dedicated atomic commitsgitconfiguration tomodules/home/shell/git.nixand isolate user GUI tools (pavucontrol,pulseaudio,tailscale-systray) to per-user home featuresmkModuleV2andmkModulehelperschecks.nix