Skip to content

Conversation

pcasaretto
Copy link
Contributor

Summary

This PR adds compatibility with flake-schemas by:

  • Confirming the existing homeModules.default structure follows flake-schemas conventions
  • Adding backwards compatibility for the legacy homeManagerModules naming with deprecation warnings
  • Maintaining full functionality while encouraging migration to standard naming

Changes

  • Added homeManagerModules.default with deprecation warning that references homeModules.default
  • Uses builtins.trace to show warning when legacy naming is accessed

Flake-schemas compatibility verification

Output of nix run github:DeterminateSystems/nix-src/flake-schemas -- flake show .:

├───homeManagerModules
│   └───(unknown flake output)
├───homeModules
│   └───default: Home Manager module

homeModules.default is properly recognized as "Home Manager module"
⚠️ homeManagerModules shows as "(unknown flake output)" - this is expected for the deprecated compatibility layer

Testing

Test flake-schemas compatibility:

nix run github:DeterminateSystems/nix-src/flake-schemas -- flake show .

Test both module access patterns:

# New standard naming (no warnings)
nix eval '.#homeModules.default' >/dev/null 2>&1 && echo "✅ homeModules accessible"

# Legacy naming (shows deprecation warning)
nix eval '.#homeManagerModules.default' 2>&1 | grep -q "WARNING.*deprecated" && echo "✅ Deprecation warning shown"

Test Home Manager integration:

{
  inputs.try.url = "github:tobi/try";
  
  # Either format works:
  home-manager.users.username = {
    imports = [ inputs.try.homeModules.default ];          # ✅ Recommended
    # imports = [ inputs.try.homeManagerModules.default ]; # ⚠️  Deprecated but works
    programs.try.enable = true;
  };
}

🤖 Generated with Claude Code

- Migrate to flake-schemas recognized homeModules format
- Add backwards compatibility for homeManagerModules with deprecation warning
- Maintains full compatibility while encouraging standard naming

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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