This file contains conventions and guidelines for contributing to this Nix-based dotfiles repository.
This repository uses git-emoji conventions via Fish functions. The format is:
g<type> "<scope>" "<message>"The functions automatically format commits as: <type>(<scope>): <emoji> <message>
| Function | Type | Emoji | Description |
|---|---|---|---|
gfeat |
feat | ✨ | New features or functionality |
gfix |
fix | 🐛 | Bug fixes |
gdocs |
docs | 📝 | Documentation changes |
gstyle |
style | 🎨 | Code style changes (formatting, etc.) |
gref |
refactor | ♻️ | Code refactoring without functionality changes |
gtest |
test | ✅ | Adding or modifying tests |
gchore |
chore | 🧹 | Build process, tooling, or maintenance tasks |
gperf |
perf | ⚡ | Performance improvements |
gci |
ci | 👷 | Continuous integration changes |
gdepup |
chore | ⬆ | Dependency upgrades |
gdepdown |
chore | ⬇️ | Dependency downgrades |
gwip |
wip | 🚧 | Work in progress (auto-generates message) |
Use specific module names for targeted changes, broader categories for cross-cutting changes:
Platform-specific:
nix- Nix language files, flake configurationdarwin- macOS system-level configurationhomemanager- Home Manager specific changes
Module-specific:
aerospace- Window manager configurationcatppuccin- Theme configurationdelta- Git diff tool configurationfzf- Fuzzy finder integrationsghostty- Terminal emulator settingsgit- Git configurationlsd- Directory listing tool configraycast- Raycast launcher settingsshell- Fish shell configuration
Infrastructure:
ci- GitHub Actions, workflowsrelease- Release configuration, changelogstest- Test files and configuration
gfeat "nix" "add Claude Code and Firefox packages"
gfix "shell" "resolve Fish completion generation issues"
gdocs "readme" "update installation instructions"
gtest "ci" "add tests for GitHub Actions workflow"
gchore "ci" "remove temporary migration files"
gref "fzf" "consolidate fuzzy finder integrations"
gdepup "nix" "update nixpkgs to latest unstable"feat(nix): ✨ add Claude Code and Firefox packages
fix(fish): 🐛 resolve plugin hash mismatches
docs(readme): 📝 update installation instructions
test(packages): ✅ add tests for new GUI applications
chore(migration): 🧹 remove temporary migration files
refactor(shell): ♻️ consolidate Fish plugin configuration
- nixpkgs (preferred) - Official Nix package repository
- brew-nix (fallback) - When packages aren't available in nixpkgs
- fail - Don't add packages that aren't available through either source
Before adding any package, always check nixpkgs availability:
nix search nixpkgs <package-name>All new packages must include comprehensive tests in the appropriate test file:
- System packages:
test/packages.test.fish - Fish configuration:
test/fish-config.test.fish
Test format:
@test "<package> is available and working" (<command> --version | string match -q "<expected-output>")flake.nix- Main Nix flake configurationdarwin/- macOS system-level configurationhome-manager/- User-level package and configuration managementtest/- Fishtape test suites
home-manager/packages.nix- User packages and CLI toolshome-manager/shell.nix- Fish shell configuration and pluginshome-manager/default.nix- Home Manager entry point and environment variables
make test # Run all tests
make test-quick # Run tests without slow container checks- Package Tests - Verify installed packages work correctly
- Configuration Tests - Verify Fish shell aliases, functions, and environment
- Integration Tests - Verify complete system functionality
- Make your changes to the appropriate Nix files
- Run tests to ensure everything works:
make test - Build the configuration:
make switch - Write tests for any new packages or functionality
- Commit using git-emoji conventions
- Ensure all changes are committed and pushed
- Run
make releaseto create a new version tag based on conventional commits - The GitHub workflow will automatically create a release with changelogs
- Use
make changelogto preview what will be included in the next release
- Check if available in nixpkgs:
nix search nixpkgs <package> - Add to appropriate packages list in
home-manager/packages.nixorflake.nix - Write tests in
test/packages.test.fish - Run
make testto verify - Commit with appropriate git-emoji message
Fish plugins are managed declaratively in home-manager/shell.nix. When adding plugins:
- Use
nix-prefetch-githubto get correct hash - Add minimal, essential plugins only
- Remove redundant plugins (prefer home-manager modules when available)
- Test plugin functionality
- Declarative Configuration - All system state defined in code
- Reproducible Environments - Same configuration across machines
- Atomic Updates - Changes are applied all-or-nothing
- Multi-Profile Support - Different configurations for work/personal
This configuration is optimized for Apple Silicon Macs (aarch64-darwin) only:
- Container management via OrbStack (native ARM64)
- All packages built natively without Rosetta
- Two profiles:
personalandwork
- Hash Mismatches: Use
nix-prefetch-github owner repo --rev <revision>to get correct hash - Build Failures: Check if package is available for your architecture
- Plugin Conflicts: Remove redundant plugins that conflict with home-manager modules
- Check existing issues and documentation
- Run tests to isolate the problem
- Verify configuration syntax with
nix flake check - Review recent commit history for similar fixes
- Use consistent indentation (2 spaces)
- Group related configuration logically
- Add comments for complex or non-obvious configurations
- Use descriptive variable names
- Follow Fish shell best practices
- Use functions over aliases for complex operations
- Keep configuration minimal and focused
- Never commit secrets or API keys
- Use environment variables for sensitive configuration
- Regularly update package pins for security fixes
- Review package sources before adding dependencies