mirror of
https://github.com/BalrajSinghGidda/nixos-dotfiles.git
synced 2026-04-07 09:27:23 +00:00
3.5 KiB
3.5 KiB
Contributing to NixOS Dotfiles
First off, thanks for taking the time to contribute! 🎉
For New Users
If you're new to this repository:
-
Read the documentation
-
Understand the structure
hosts/- Host-specific configurationsmodules/nixos/- System-level modulesmodules/home-manager/- User-level modulesconfig/- Application dotfiles
Making Changes
For Your Own Fork
-
Clone and customize
git clone https://github.com/YOUR_USERNAME/nixos-dotfiles ~/nixos-dotfiles cd ~/nixos-dotfiles -
Update personal information
- Change username in
hosts/nixos-btw/home.nixandmodules/nixos/core.nix - Update Git info in
modules/home-manager/git.nix - Copy your hardware config:
sudo cp /etc/nixos/hardware-configuration.nix hosts/nixos-btw/
- Change username in
-
Test your changes
make build # Test build without applying make test # Test without making it permanent make switch # Apply permanently
For Contributing Back
-
Fork the repository
-
Create a feature branch
git checkout -b feature/my-awesome-feature -
Make your changes
- Follow the existing code style
- Add comments for complex configurations
- Update documentation if needed
-
Test thoroughly
make check # Validate flake make build # Test build -
Commit with clear messages
git commit -m "Add: Feature description"Use prefixes:
Add:- New featureFix:- Bug fixUpdate:- Update existing featureDocs:- Documentation changesRefactor:- Code restructuring
-
Push and create Pull Request
git push origin feature/my-awesome-feature
Code Style
Nix Files
- Use 2 spaces for indentation
- Add comments for non-obvious configurations
- Group related settings together
- Keep modules focused on single responsibilities
Example:
{ pkgs, ... }:
{
# Audio configuration
services.pipewire = {
enable = true;
pulse.enable = true; # PulseAudio compatibility
};
}
Comments
- Explain why, not what (the code shows what)
- Add comments for hardware-specific tweaks
- Document any workarounds or hacks
Module Guidelines
Creating New Modules
- Keep it focused - One module = One domain
- Make it reusable - Avoid hardcoding user-specific values
- Document it - Add comments and update MODULE_GUIDE.md
- Test it - Ensure it builds and works
Module Template
# modules/nixos/my-feature.nix
{ config, pkgs, ... }:
{
# Brief description of what this module does
# Group related configurations
services.my-service = {
enable = true;
# Add inline comments for complex settings
setting = "value";
};
}
Submitting Issues
Bug Reports
Include:
- NixOS version (
nixos-version) - Steps to reproduce
- Expected vs actual behavior
- Error messages (if any)
Feature Requests
Include:
- Clear description of the feature
- Use case / motivation
- Examples from other configs (if applicable)
Questions?
- Open an issue for configuration questions
- Check existing issues and PRs first
- Be respectful and patient
License
By contributing, you agree that your contributions will be included under the same terms as the original repository.
Thank you for contributing! 🚀