Note: This is my personal NixOS configuration. It's tailored to my specific needs, hardware, and preferences. While you're welcome to browse and learn from it, please be aware that applying these configurations directly to your system may not work as expected or could potentially cause issues.
This repository contains my complete NixOS configuration using Nix Flakes, featuring a modular architecture with support for multiple hosts, desktop environments, and development workflows.
The configuration is built using a modular flake-based architecture with the following key components:
- Flake-based: Modern Nix configuration using flakes for reproducible builds
- Multi-host support: Configurations for different machines and environments
- Modular design: Reusable modules for NixOS and Home Manager
- Development environments: Multiple dev shells for different workflows
- Secrets management: Age-encrypted secrets handling
โโโ flake.nix # Main flake configuration
โโโ flake.lock # Locked flake inputs
โโโ Justfile # Task runner for common operations
โโโ secrets.nix # Secrets configuration
โโโ install.sh # Installation script
โโโ diff.sh # Configuration diff utility
โ
โโโ hosts/ # Host-specific configurations
โ โโโ asus-zephyrus-gu603/ # Gaming laptop configuration
โ โโโ dostov-dev/ # Development machine
โ โโโ wsl/ # WSL environment
โ
โโโ modules/ # Reusable modules
โ โโโ nixos/ # NixOS system modules
โ โ โโโ desktop/ # Desktop environments (GNOME, Hyprland, KDE)
โ โ โโโ hardware/ # Hardware-specific configurations
โ โ โโโ programs/ # System programs
โ โ โโโ presets/ # Configuration presets
โ โโโ home-manager/ # Home Manager modules
โ โโโ programs/ # User programs
โ โโโ functionality/ # User functionality modules
โ
โโโ dev-shells/ # Development environments
โ โโโ kubernetes.nix # Kubernetes development
โ โโโ laravel.nix # PHP/Laravel development
โ โโโ python.nix # Python development
โ
โโโ flakes/ # Custom flakes
โ โโโ astal-shells/ # Custom shell configurations
โ โโโ nvf/ # Neovim configuration
โ
โโโ pkgs/ # Custom packages
โ โโโ by-name/ # Package definitions
โ โโโ scripts/ # System scripts
โ โโโ vim-plugins/ # Custom Vim plugins
โ
โโโ overlays/ # Nixpkgs overlays
โโโ templates/ # Module templates
โโโ secrets/ # Encrypted secrets
โโโ users/ # User-specific configurations
- asus-zephyrus-gu603: ASUS Zephyrus gaming laptop with NVIDIA graphics
- dostov-dev: Development workstation
- wsl: Windows Subsystem for Linux setup
This configuration supports multiple desktop environments:
- Hyprland: Wayland compositor with extensive customization
- GNOME: Traditional desktop environment
- KDE Plasma: Feature-rich desktop environment
Pre-configured development shells for:
- Kubernetes: Container orchestration development
- Laravel/PHP: Web development with PHP and Laravel
- Python: Python development with common tools
- Default: General development environment
- Impermanence: Stateless system with persistent data management
- Disko: Declarative disk partitioning
- Secrets: Age-encrypted secrets management
- Backups: Automated backup solutions with Restic
- Hyprland: Modern Wayland compositor with custom theming
- HyprPanel: Custom status bar and system panels
- Stylix: System-wide theming
- Multiple browsers: Firefox, Chromium, Zen Browser support
- Neovim: Heavily customized with nvf
- Terminal multiplexers: tmux, Zellij support
- Shells: Nushell, Zsh configurations
- Version control: Git, Jujutsu (jj)
- Containers: Docker, Podman support
- Gaming: Steam integration
- Productivity: Various development and productivity tools
- Multimedia: Audio/video editing capabilities
- Networking: VPN (Mullvad), network tools
- NixOS installed system
- Git
- Basic understanding of Nix/NixOS
-
Clone the repository:
git clone <repository-url> /etc/nixos cd /etc/nixos
-
Review and customize:
- Check
hosts/
for available configurations - Modify hardware configurations to match your system
- Update user configurations in
users/
- Check
-
Install using the script:
chmod +x install.sh ./install.sh
Or manually:
sudo nixos-rebuild switch --flake .#<hostname>
# Update all flake inputs
just update
# Update specific input
just update-input nixpkgs
# Rebuild system
just nix-upgrade switch
# Run tests
just test
# View all available commands
just --list
- Create a new directory in
hosts/
- Add configuration files (
default.nix
,hardware.nix
, etc.) - Update
hosts/default.nix
to include the new host - Rebuild with
just nix-upgrade switch
- Create a module in appropriate directory (
modules/nixos/programs/
ormodules/home-manager/programs/
) - Import the module in the relevant
all.nix
file - Enable in host or user configurations
Access development environments:
nix develop .#kubernetes # Kubernetes development
nix develop .#laravel # Laravel development
nix develop .#python # Python development
This configuration uses agenix
for secrets management:
- Secrets are stored in
secrets/
directory - Encrypted with age
- Referenced in
secrets.nix
- NVIDIA: Proprietary drivers with proper configuration
- Intel: Integrated graphics support
- ASUS: Specific optimizations for ASUS hardware
- Power management: TLP, auto-cpufreq
- Display: HiDPI and multi-monitor support
- Bluetooth: Full Bluetooth stack
- Audio: PipeWire audio system
- Keyboards: QMK and custom layouts support
This configuration pulls from numerous upstream sources:
- NixOS/nixpkgs: Core packages
- Home Manager: User environment management
- Hyprland: Wayland compositor
- Stylix: System theming
- nvf: Neovim configuration framework
- And many more - see
flake.nix
for complete list
- Personal Configuration: This is specifically tailored for my use case
- Hardware Specific: Some configurations are tied to specific hardware
- Experimental Features: Uses unstable Nix features and packages
- Regular Updates: Configurations change frequently
- No Warranty: Use at your own risk
While this is a personal configuration, if you find bugs or have suggestions:
- Open an issue describing the problem
- Provide relevant system information
- Include error messages or logs
This configuration is provided as-is for educational and reference purposes. Feel free to learn from it, but please adapt it to your own needs rather than using it directly.
This configuration is built upon the excellent work of the Nix community and draws inspiration from many other configurations. Special thanks to:
- The NixOS team and community
- Home Manager maintainers
- Hyprland developers
- All the package maintainers and contributors
Remember: This is a personal configuration. Always review and understand what you're applying to your system before running any commands.