A clean, modular NixOS configuration built with flakes, featuring a streamlined development environment with essential security and practical quality-of-life improvements. Designed for simplicity and maintainability without unnecessary bloat.
π― Focus: This configuration prioritizes practical development over comprehensive features. It includes everything you need for Go, Python, JavaScript, and Nix development while maintaining system security and performance.
- Flake-based configuration for reproducible builds
- Modular design with organized component separation
- Host-specific configurations for different machines
- Shared modules for common functionality
- Hyprland - Modern Wayland compositor
- Custom theming with Catppuccin colors
- Font management with Nerd Fonts support
- Application launcher and desktop utilities
- Multi-language support: Go, Python (with uv), JavaScript/TypeScript, Nix
- Modern tooling: uv for Python package management, Neovim with LSP, VS Code
- Enhanced shell with Zsh, Starship prompt, modern CLI tools (bat, eza, fd, ripgrep)
- Git workflow with delta, lazygit, GitHub CLI, and proper configuration
- Container support with Docker and development utilities
- Streamlined security with essential protections only
- Basic firewall with clean, minimal rules
- Sudo hardening with wheel group restrictions
- Essential kernel settings for system protection
- No bloat - AppArmor, Fail2ban, and complex auditing removed for simplicity
- Simple maintenance with automated weekly cleanup
- System monitoring with health checks and performance tuning
- Essential utilities (
system-info,rebuild,cleanup) - Hardware support via nixos-hardware and optimized settings
- Automated updates with rollback capabilities
.
βββ flake.nix # Main flake configuration
βββ hosts/
β βββ kr_laptop/ # Host-specific configs
β βββ configuration.nix
β βββ hardware-configuration.nix
βββ modules/
βββ desktop/ # Desktop environment & UI
β βββ hyprland.nix # Wayland compositor
β βββ themes.nix # Color schemes & fonts
β βββ fonts.nix # Font configuration
βββ programs/
β βββ development.nix # Dev tools & languages
β βββ shell.nix # Shell & CLI tools
β βββ applications.nix # Desktop applications
βββ system/
β βββ security.nix # Basic security configuration
β βββ monitoring.nix # System monitoring
β βββ maintenance.nix # Simple maintenance tools
β βββ optimization.nix # Performance tuning
βββ services/ # System services
βββ shared/ # Common configurations
- NixOS installed with flakes enabled
- Git configured
-
Clone the repository
git clone https://github.com/K4rlosReyes/kr7x-nixos.git ~/.kr_flake cd ~/.kr_flake
-
Customize for your system
- Copy
hosts/kr_laptop/configuration-example.nixto your own host config - Update hardware configuration:
nixos-generate-config --dir hosts/your-host/ - Modify
flake.nixto include your host
- Copy
-
Build and switch
sudo nixos-rebuild switch --flake .#your-host
The configuration includes powerful management utilities with enhanced functionality:
# System information with detailed health check
system-info # Comprehensive system status and health
# Flexible rebuild options
rebuild # Quick rebuild and switch
rebuild --test # Build and test without activating
rebuild --boot # Build and activate on next boot
rebuild --dry-run # Show what would be built
rebuild --rollback # Rollback to previous generation
# Smart cleanup with options
cleanup # Interactive cleanup (keeps 7 days)
cleanup --force # Non-interactive cleanup
cleanup --keep-days 14 # Keep generations for 14 daysAll commands include --help for detailed usage information.
- Languages: Go, Python (with uv package manager), JavaScript/TypeScript, Nix
- Editors: Neovim (LSP configured for all languages), VS Code with language extensions
- CLI Tools: bat (cat replacement), eza (ls replacement), fd (find), ripgrep (grep), delta (git diff)
- Git Workflow: lazygit, GitHub CLI (gh), proper Git configuration with aliases
- Python: uv for fast package management, pytest, mypy, ipython, jupyterlab
- Containers: Docker with proper daemon setup and user permissions
- Browser: Brave
- Terminal: Kitty
- File Manager: Thunar with archive support and plugins
- Development: VS Code, Neovim, Git tools
- Media: MPV media player
- Shell: Zsh, autosuggestions, syntax highlighting
- Prompt: Starship with custom prompt showing git status, Python env, etc.
- Fonts: Nerd Fonts collection for proper icon rendering
- Theme: Consistent theming with good contrast and readability (+-)
- Python Aliases: Modern uv-based workflow (uvi, uvs, uvx commands)
- Performance: Optimized settings for development workloads
This configuration follows a "security without bloat" approach:
- Essential Protection: Basic firewall, sudo hardening, key kernel settings
- Practical Security: Focus on protections that matter for development workstations
- Maintainable: Simple configurations that are easy to understand and modify
- Performance: Security measures that don't impact development workflow
The configuration uses a modular approach. Enable or disable features in your host configuration:
myModules = {
development = {
enable = true;
languages = [ "python" "go" "javascript" "nix" ];
editors = [ "neovim" ];
python = {
enable = true;
packageManager = "uv"; # Fast Python package management
};
};
system = {
security.enable = true; # Basic security without bloat
monitoring.enable = true; # System health monitoring
maintenance.enable = true; # Automated maintenance
};
desktop = {
enable = true;
hyprland.enable = true; # Wayland compositor
applications.enable = true; # Essential desktop apps
};
};- Create a new directory in
hosts/ - Add
configuration.nixandhardware-configuration.nix - Update
flake.nixwith the new host entry - Build with
nixos-rebuild switch --flake .#new-host
This configuration has been recently streamlined and simplified:
- Python development - Full uv integration with modern workflow aliases
- Essential security - Kept only practical protections that matter
- System monitoring - Clean health checks and performance optimization
- Modular design - Better separation of concerns and easier customization
- Practical over Perfect - Focus on daily development needs
- Simple over Complex - Avoid unnecessary abstraction and bloat
- Maintainable over Feature-Rich - Easier to understand and modify
- Performance over Completeness - Fast rebuilds and responsive system
Contributions are welcome! This configuration prioritizes:
- Simplicity - Easy to understand and modify
- Modularity - Clean separation of components
- Documentation - Clear code with explanations
- Practicality - Real-world development focused
- Performance - Fast rebuilds and system responsiveness
- Fork the repository
- Create a feature branch
- Test changes in a VM or non-production system
- Ensure changes follow the simplicity philosophy
- Update documentation as needed
- Submit a pull request with clear description
- Start Small - Enable only essential modules initially
- Test Incrementally - Add features one at a time
- Backup First - Always have a rollback plan ready
- Read the Code - Understand what each module does
# Quick rebuild and switch
rebuild
# Check comprehensive system health
system-info
# Clean up after major changes (interactive)
cleanup
# Test configuration without activating
rebuild --test
# Check for issues before committing changes
nix flake check
# Show what would be built
rebuild --dry-run# Enable Python development with specific tools
myModules.development.python = {
enable = true;
packages = [ "pytest" "mypy" "black" ];
};
# Add custom security settings
myModules.system.security = {
enable = true;
firewall.allowedTCPPorts = [ 8080 3000 ];
};
# Customize desktop applications
myModules.desktop.applications = {
enable = true;
categories = [ "development" "media" "office" ];
};- NixOS Manual - Official documentation
- Nix Flakes Guide - Modern Nix configuration
- NixOS Options Search - Find configuration options
- Nix Packages Search - Browse available packages
- Home Manager - User environment management
- NixOS Hardware - Hardware-specific configurations
- DevShells - Development environments
- CLEANUP_SUMMARY.md - Detailed log of recent simplification changes
- DOTFILES.md - Dotfiles integration and management guide
- Module comments - Each module is documented with usage examples
Build Failures:
# Check for syntax errors and configuration issues
nix flake check
# Test build without activating
rebuild --dry-run
# Update flake inputs if needed
nix flake update
# Clear cache if corrupted
sudo rm -rf /nix/var/nix/profiles/system-*-linkSystem Issues:
# Comprehensive system status and health check
system-info
# View recent logs
journalctl -xe
# Rollback to previous generation (quick method)
rebuild --rollback
# Or traditional rollback
sudo nixos-rebuild switch --rollbackDevelopment Environment:
# Rebuild neovim configuration
nvim --headless +qa
# Fix Python uv installation
uv self update
# Check Docker permissions
sudo usermod -aG docker $USER
# Clean development environment
cleanup --keep-days 3Performance Issues:
# Check system resources
system-info
# Monitor real-time performance
btop
# Clean up old generations aggressively
cleanup --keep-days 1 --forceThis configuration is available under the MIT License. Feel free to use, modify, and share!
- The NixOS community for excellent documentation and packages
- Contributors to nixos-hardware for device-specific configurations
- The Hyprland project for an amazing Wayland compositor
- All the open source projects that make this configuration possible
Note: This is a personal configuration optimized for development workstations. Review and customize the security settings, package selections, and configurations before using in production environments.
This configuration has been thoroughly tested and optimized as of June 2025:
- β Simplified Architecture - Removed bloat while maintaining functionality
- β
Enhanced Management - Robust
system-info,rebuild, andcleanupcommands - β Active Monitoring - System health checks running every 30 minutes
- β Automated Maintenance - Weekly Nix store cleanup and optimization
- β Conflict Resolution - All duplicate configurations and sysctl conflicts resolved
- β Python/uv Integration - Modern Python development workflow fully configured
- β Security Hardening - Essential protections without complexity
- β Documentation - Comprehensive README with troubleshooting guides
Last Updated: June 6, 2025 - Status: Production Ready β