Skip to content

viicslen/nixos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Personal NixOS Configuration

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.

๐Ÿ“– Overview

This repository contains my complete NixOS configuration using Nix Flakes, featuring a modular architecture with support for multiple hosts, desktop environments, and development workflows.

๐Ÿ—๏ธ Architecture

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

๐Ÿ“ Repository Structure

โ”œโ”€โ”€ 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

๐Ÿ’ป Supported Hosts

๐Ÿ–ฅ๏ธ Physical Machines

  • asus-zephyrus-gu603: ASUS Zephyrus gaming laptop with NVIDIA graphics
  • dostov-dev: Development workstation

๐ŸŒ Virtual Environments

  • wsl: Windows Subsystem for Linux setup

๐ŸŽจ Desktop Environments

This configuration supports multiple desktop environments:

  • Hyprland: Wayland compositor with extensive customization
  • GNOME: Traditional desktop environment
  • KDE Plasma: Feature-rich desktop environment

๐Ÿ› ๏ธ Development Environments

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

๐Ÿ“ฆ Key Features

๐Ÿ”ง System Management

  • Impermanence: Stateless system with persistent data management
  • Disko: Declarative disk partitioning
  • Secrets: Age-encrypted secrets management
  • Backups: Automated backup solutions with Restic

๐Ÿ–ฅ๏ธ Desktop Experience

  • 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

๐Ÿ› ๏ธ Development Tools

  • Neovim: Heavily customized with nvf
  • Terminal multiplexers: tmux, Zellij support
  • Shells: Nushell, Zsh configurations
  • Version control: Git, Jujutsu (jj)
  • Containers: Docker, Podman support

๐Ÿ“ฑ Applications

  • Gaming: Steam integration
  • Productivity: Various development and productivity tools
  • Multimedia: Audio/video editing capabilities
  • Networking: VPN (Mullvad), network tools

๐Ÿš€ Quick Start

๐Ÿ“‹ Prerequisites

  • NixOS installed system
  • Git
  • Basic understanding of Nix/NixOS

๐Ÿ”ง Installation

  1. Clone the repository:

    git clone <repository-url> /etc/nixos
    cd /etc/nixos
  2. Review and customize:

    • Check hosts/ for available configurations
    • Modify hardware configurations to match your system
    • Update user configurations in users/
  3. Install using the script:

    chmod +x install.sh
    ./install.sh

    Or manually:

    sudo nixos-rebuild switch --flake .#<hostname>

โšก Available Commands (using Just)

# 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

๐Ÿ”ง Customization

๐Ÿ  Adding a New Host

  1. Create a new directory in hosts/
  2. Add configuration files (default.nix, hardware.nix, etc.)
  3. Update hosts/default.nix to include the new host
  4. Rebuild with just nix-upgrade switch

๐Ÿ“ฆ Adding New Programs

  1. Create a module in appropriate directory (modules/nixos/programs/ or modules/home-manager/programs/)
  2. Import the module in the relevant all.nix file
  3. Enable in host or user configurations

๐Ÿš Development Shells

Access development environments:

nix develop .#kubernetes  # Kubernetes development
nix develop .#laravel     # Laravel development
nix develop .#python      # Python development

๐Ÿ” Secrets Management

This configuration uses agenix for secrets management:

  • Secrets are stored in secrets/ directory
  • Encrypted with age
  • Referenced in secrets.nix

โš™๏ธ Hardware Support

๐ŸŽฎ Graphics

  • NVIDIA: Proprietary drivers with proper configuration
  • Intel: Integrated graphics support

๐Ÿ’ป Laptops

  • ASUS: Specific optimizations for ASUS hardware
  • Power management: TLP, auto-cpufreq
  • Display: HiDPI and multi-monitor support

๐Ÿ”Œ Peripherals

  • Bluetooth: Full Bluetooth stack
  • Audio: PipeWire audio system
  • Keyboards: QMK and custom layouts support

๐Ÿ“‹ Dependencies

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

โš ๏ธ Important Notes

  • 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

๐Ÿค Contributing

While this is a personal configuration, if you find bugs or have suggestions:

  1. Open an issue describing the problem
  2. Provide relevant system information
  3. Include error messages or logs

๐Ÿ“œ License

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.

๐Ÿ™ Acknowledgments

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published