Skip to content

About

KR7X's NixOS """simple""" config

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ KR7X's NixOS Configuration

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.

✨ Features

πŸ—οΈ Modular Architecture

  • Flake-based configuration for reproducible builds
  • Modular design with organized component separation
  • Host-specific configurations for different machines
  • Shared modules for common functionality

πŸ–₯️ Desktop Environment

  • Hyprland - Modern Wayland compositor
  • Custom theming with Catppuccin colors
  • Font management with Nerd Fonts support
  • Application launcher and desktop utilities

πŸ’» Development Environment

  • 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

πŸ”’ Security

  • 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

βš™οΈ System Management

  • 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

πŸ“ Structure

.
β”œβ”€β”€ 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

πŸš€ Quick Start

Prerequisites

  • NixOS installed with flakes enabled
  • Git configured

Installation

  1. Clone the repository

    git clone https://github.com/K4rlosReyes/kr7x-nixos.git ~/.kr_flake
    cd ~/.kr_flake
  2. Customize for your system

    • Copy hosts/kr_laptop/configuration-example.nix to your own host config
    • Update hardware configuration: nixos-generate-config --dir hosts/your-host/
    • Modify flake.nix to include your host
  3. Build and switch

    sudo nixos-rebuild switch --flake .#your-host

πŸ”§ Management Commands

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 days

All commands include --help for detailed usage information.

πŸ“¦ Key Components

Development Tools

  • 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

Desktop Applications

  • Browser: Brave
  • Terminal: Kitty
  • File Manager: Thunar with archive support and plugins
  • Development: VS Code, Neovim, Git tools
  • Media: MPV media player

System Features

  • 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

πŸ›‘οΈ Security Philosophy

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

🎨 Customization

Enabling/Disabling Modules

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
  };
};

Adding New Hosts

  1. Create a new directory in hosts/
  2. Add configuration.nix and hardware-configuration.nix
  3. Update flake.nix with the new host entry
  4. Build with nixos-rebuild switch --flake .#new-host

πŸ”„ Recent Changes & Philosophy

This configuration has been recently streamlined and simplified:

What Was Enhanced

  • 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

Design Philosophy

  • 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

🀝 Contributing

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

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Test changes in a VM or non-production system
  4. Ensure changes follow the simplicity philosophy
  5. Update documentation as needed
  6. Submit a pull request with clear description

πŸ’‘ Tips & Best Practices

First-Time Setup

  1. Start Small - Enable only essential modules initially
  2. Test Incrementally - Add features one at a time
  3. Backup First - Always have a rollback plan ready
  4. Read the Code - Understand what each module does

Development Workflow

# 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

Customization Examples

# 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" ];
};

πŸ“š Resources & Documentation

Essential NixOS Resources

Development & Tools

This Configuration

  • 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

πŸ”§ Troubleshooting

Common Issues

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-*-link

System 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 --rollback

Development 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 3

Performance Issues:

# Check system resources
system-info

# Monitor real-time performance
btop

# Clean up old generations aggressively
cleanup --keep-days 1 --force

πŸ“„ License

This configuration is available under the MIT License. Feel free to use, modify, and share!

πŸ™ Acknowledgments

  • 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.

βœ… Current Status

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, and cleanup commands
  • βœ… 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 βœ…

About

KR7X's NixOS """simple""" config

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages